1、mysql 在linux端安装
yum list installed mysql* # 查看有没有安装过
yum -y install mysql-server # 服务器端
yum -y install mysql-devel # 服务器端
yum -y install mysql # 客户端
2、mysql 在linux端配置
/etc/my.cnf 加入 default-character-set=utf8
# 启动mysql服务
service mysqld start 或 /etc/init.d/mysqld start
service mysqld restart
# 开机自动启动
chkconfig --list | grep mysql*
chkconfig --add mysqld
chkconfig mysqld on
chkconfig --list | grep mysql*
# 创建root管理员
mysqladmin -u root password 123456
# 试登录
mysql -u root -p123456
quit
mysql --version
3、开启远程访问
# 格式:grant 权限 on 数据库名.表名 用户@登录主机 identified by "用户密码";
# (root,%)用于远程登录,而(root,localhost)用于本地登录
show databases;
describe mysql.user;
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";
GRANT ALL PRIVILEGES ON *.* TO test@"%" IDENTIFIED BY "123456";
-- update mysql.user set host='%' where user = 'test';
select user,host,password from mysql.user;
flush privileges;
# Linux上打开3306端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/init.d/iptables save
service iptables restart
# Windows本机远程连接
1) 安装windows mysql
2) Windows版的配置:
http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html
3) mysql -h192.168.22.250 --port=3306 -uroot -p123456
Reference
http://jingyan.baidu.com/article/acf728fd10c3d6f8e510a3ef.html
http://zhidao.baidu.com/question/180138320.html
http://jingyan.baidu.com/article/63acb44add614761fcc17ec2.html
http://blog.csdn.net/chana1101/article/details/39641415
http://jingyan.baidu.com/article/95c9d20dac9040ec4f75617a.html
yum list installed mysql* # 查看有没有安装过
yum -y install mysql-server # 服务器端
yum -y install mysql-devel # 服务器端
yum -y install mysql # 客户端
2、mysql 在linux端配置
/etc/my.cnf 加入 default-character-set=utf8
# 启动mysql服务
service mysqld start 或 /etc/init.d/mysqld start
service mysqld restart
# 开机自动启动
chkconfig --list | grep mysql*
chkconfig --add mysqld
chkconfig mysqld on
chkconfig --list | grep mysql*
# 创建root管理员
mysqladmin -u root password 123456
# 试登录
mysql -u root -p123456
quit
mysql --version
3、开启远程访问
# 格式:grant 权限 on 数据库名.表名 用户@登录主机 identified by "用户密码";
# (root,%)用于远程登录,而(root,localhost)用于本地登录
show databases;
describe mysql.user;
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "123456";
GRANT ALL PRIVILEGES ON *.* TO test@"%" IDENTIFIED BY "123456";
-- update mysql.user set host='%' where user = 'test';
select user,host,password from mysql.user;
flush privileges;
# Linux上打开3306端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/init.d/iptables save
service iptables restart
# Windows本机远程连接
1) 安装windows mysql
2) Windows版的配置:
http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html
3) mysql -h192.168.22.250 --port=3306 -uroot -p123456
Reference
http://jingyan.baidu.com/article/acf728fd10c3d6f8e510a3ef.html
http://zhidao.baidu.com/question/180138320.html
http://jingyan.baidu.com/article/63acb44add614761fcc17ec2.html
http://blog.csdn.net/chana1101/article/details/39641415
http://jingyan.baidu.com/article/95c9d20dac9040ec4f75617a.html
http://www.centoscn.com/CentOS/help/2013/0725/558.html