温馨提示×

linux怎么搭建mysql服务器

九三
235
2021-02-11 16:49:51
栏目: 云计算

linux怎么搭建mysql服务器

linux搭建mysql服务器的方法

1.首先,在Linux命令行中使用yum命令,安装mysql服务;

yum install -y mysql-server mysql mysql-devel

2.等待mysql服务安装好后,开启mysql服务,并mysql服务进行重启;

service mysqld start

service mysqld restart

3.mysql服务重启后,将mysql服务设置成为开机自启;

chkconfig --list | grep mysqld

chkconfig mysqld on

4.mysql服务设置好后,登录mysql;

mysql -u root -p

5.登录到mysql后,在mysql中配置外网访问权限;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;

6.外网访问权限配置好后,修改mysql的登录密码;

UPDATE mysql.user SET password=PASSWORD('newpassword') WHERE User='root';

7.最后,密码修改好后,对mysql进行更新即可;

FLUSH PRIVILEGES;

0