码迷,mamicode.com
首页 > 数据库 > 详细

Mysql5.6.27安装

时间:2015-11-12 11:42:11      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:

CentOs6.4
Mysql5.6.27

 

CentOs6.4
Mysql5.6.27

卸载系统mysql:
rpm -qa|grep -i mysql
rpm -e --nodeps xxx


# linux
groupadd mysql
useradd -r -g mysql mysql
cd /usr/local
ln -s mysql-5.6.27-linux-glibc2.5-x86_64 mysql
cd mysql

# 将mysql/bin加入环境变量,也就是/etc/profile文件中

# 加入默认配置文件
bin/my_print_defaults --defaults-file=/usr/local/mysql/my.cnf

# 初始化数据文件
scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/mysql3306

scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/mysql3307

# 然后出来一大段英文大概教你怎么做

# 启动后先改密码

# 否则执行时指定配置文件

mysqld_multi --defaults-extra-file=/usr/local/mysql/my.cnf report
# or
mysqld_multi --defaults-file=/usr/local/mysql/my.cnf report
# or
mysqld_multi report

# 查看
mysqld_multi report

# 启动
mysqld_multi start 3306

# 停止
mysqld_multi stop 3306 --password=root
#or 最好用这个
mysqladmin -S /tmp/mysql_3306.sock -uroot -p shutdown

# 改密码

mysqladmin -S /tmp/mysql_3307.sock -u root password ‘root‘

# 创建授权新用户,开始使用

GRANT ALL PRIVILEGES ON test.* TO ‘hive_user‘@‘%‘ IDENTIFIED BY ‘hive_user‘ WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO ‘hive_user‘@‘%‘ IDENTIFIED BY ‘hive_user‘ WITH GRANT OPTION;

revoke all on *.* from ‘hive_user‘@‘%‘;

revoke all on test.* from ‘hive_user‘@‘‘;

FLUSH PRIVILEGES;

delete from mysql.user where user=‘hive_user‘;

revoke all on *.* from ‘hive_user‘@‘%‘;

FLUSH PRIVILEGES;

 

GRANT ALL PRIVILEGES ON *.* TO ‘dev‘@‘%‘ IDENTIFIED BY ‘dev123456‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;

delete from mysql.user where user=‘dev‘;

 

Mysql5.6.27安装

标签:

原文地址:http://www.cnblogs.com/blazer/p/4958166.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!