Rootop 服务器运维与web架构

mysql 修改密码、开启远程登录(远程访问)

| 暂无评论

今天朋友做服务器,遇到了点儿问题,协助给解决了一下,其实也没什么,mysql安装及配置问题。

系统为CentOS,内核 2.6.18-164.el5

安装mysql时提示gcc编译错误,估计是没安装gcc编译器。

yum install -y gcc

yum install -y mysql

然后把相关的rpm包都装上,在此不做写出

登陆mysql:

默认用户名为root,密码为空

[root@fast ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.0.77 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

修改密码为123:

mysql> set password=password(‘123’);
Query OK, 0 rows affected (0.00 sec)

需要远程登录mysql数据库,默认是关闭的,要启动它:

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’IDENTIFIED BY ‘YOURPASSWORD’ WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

刷新生效

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

完成。

原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/116.html

作者:Venus

服务器运维与性能优化

发表回复