mysql安装:

yum list mysql-server

yum install mysql-server


启动mysql服务:

service mysqld start

尝试连接mysql

然后\q关闭连接


设置mysql开机启动:

chkconfig mysqld on

chkconfig --list



Mysql管理:

设置密码:

mysql

use mysql;

update user set password=password('密码') where user='root';

flush privileges;


设置mysql远程访问:

grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;


mysql远程连接命令:

mysql -h主机地址 -u用户名 -p用户密码




数据库操作:

显示所有数据库:

show databases;


显示所有表

show tables;