linux搭建mysql服务器的方法
首先,在Linux命令行中使用yum命令,安装mysql服务;
yum install -y mysql-server mysql mysql-devel
等待mysql服务安装好后,开启mysql服务,并mysql服务进行重启;
service mysqld start
service mysqld restart
mysql服务重启后,将mysql服务设置成为开机自启;
chkconfig --list | grep mysqld
chkconfig mysqld on
mysql服务设置好后,登录mysql;
mysql -u root -p
登录到mysql后,在mysql中配置外网访问权限;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
外网访问权限配置好后,修改mysql的登录密码;
UPDATE mysql.user SET password=PASSWORD('newpassword') WHERE User='root';
最后,密码修改好后,对mysql进行更新即可;
FLUSH PRIVILEGES;