1. MySQL客户端程序
[root@demoserver bin]# ./mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit
2. 更改管理员口令
MySQL安装后,管理员(root)口令默认为空。为了保证系统安全,应该更改root用户口令。命令格式:
[root@demoserver bin]# ./mysqladmin -u root password 123456
3. 使用密码登录两种方式
[root@demoserver bin]# ./mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
4. MySQL服务器管理程序mysqladmin
mysqladmin命令是mysql服务器的管理程序,可用于执行检查配置文件、检查服务状态、关闭服务器、创建数据库、删除数据库等的系统管理操作。
具体格式:
mysqladmin [options] command ....
例如:
刷新缓存中的所有信息
./mysqladmin -u root -p flush-hosts
显示正在运行的服务器线程列表
./mysqladmin -u root -p processlist