安装
yum install -y mysql-server mysql mysql-deve
启动服务
/etc/init.d/mysqld start
远程数据dump
数据库备份
mysqldump –opt -h192.168.100.23 -u user -p 123456 dbname>dbname.sql
mysql建立
create database dbname
数据库还原
mysql dbname < dbname.sql
查看mysql用户
SELECT DISTINCT CONCAT(‘User: ”’,user,”’@”’,host,”’;’) AS query FROM mysql.user;
设置root密码
use mysql;
update user set password=passworD(“123456”) where user=’root’;
flush privileges;
exit;
设置远程允许登陆(只设置一个用户)
登陆数据库
mysql -uroot -p123456
use m