首页 > 代码库 > 【MySQL】配置MySQL安装和远程访问步骤
【MySQL】配置MySQL安装和远程访问步骤
以远程服务器为例,安装Mysql到Linux并配置远程访问,步骤如下:
1.下载安装最新的rpm文件
方法一:
rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
方法二:
(最新版地址:http://mirrors.sohu.com/mysql/ )
2.安装MySQL,输入命令:
yum install mysql-community-server
3.安装完之后查看版本号
mysql -V
4.启动MySQL,输入命令:
service mysqld start
5.配置mysql开机自动启动
chkconfig mysqld on
6.查看配置状况
chkconfig --list | grep mysql
7.为管理员设置密码
mysqladmin -u root password
--------配置远程访问---------
8.进入数据库
mysql -u root -p
9.查看有多少数据库
show databases;
10.进入mysql数据库
use mysql;
11.查询user表里面的字段
select host,user,password from user;
12.然后找到localhost root 和带password的一条,并将localhost改成‘%‘(注:这里是为root账号开启访问IP的权限,最好新建一个Mysql用户再开启,不要用root)
update user set host=‘%‘ where password=‘*0049957DDE5C3C58AED‘;
13.重启mysql服务
service mysqld restart
14.本地安装:NavicatPremium,打开NavicatPremium新建一个连接,
a.选择常规,输入数据库连接信息
b.选择SSH,然后输入服务器的信息进行连接
【MySQL】配置MySQL安装和远程访问步骤
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。