gossgao
以远程服务器为例,安装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,然后输入服务器的信息进行连接

 

 

分类:

技术点:

相关文章:

  • 2021-07-14
  • 2022-02-07
  • 2021-12-02
  • 2021-12-05
  • 2021-09-20
  • 2022-12-23
  • 2021-12-17
  • 2021-08-07
猜你喜欢
  • 2022-01-01
  • 2021-03-31
  • 2021-04-05
  • 2022-12-23
  • 2021-12-19
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案