Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 上面显示可以看出MySQL服务已经启动。
3.登录MySQL的命令是mysql
第一次进时只需键入mysql即可。 [root@test1 local]# mysql
增加了密码后的登录格式如下: mysql -u root -p Enter password: (输入密码)
3)测试是否修改成功 <1>不用密码登录 [root@test1 local]# mysql ERROR 1045: Access denied for user: ‘root@localhost" (Using password: NO) 显示错误,说明密码已经修改。 <2>用修改后的密码登录 [root@test1 local]# mysql -u root -p Enter password: (输入修改后的密码123456) Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 4 to server version: 4.0.16-standard Type ‘help;" or ‘h" for help. Type ‘c" to clear the buffer. mysql> 成功! 这是通过mysqladmin命令修改口令,也可通过修改库来更改口令。
5.增加MySQL用户
grant all on *.* to "xhx"@"%" Identified by "123456";