在linux上安装mysql5.6,在linux(Centos 7以上版本亲测)上安装mysql5.6

./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql

如果执行报错

[root@dc1atmpapp12 mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db: Data::Dumper

解决方法是安装autoconf库

执行命令:yum -y install autoconf

正确执行上面命令以后

cp support-files/mysql.server /etc/init.d/mysqld

chmod 755 /etc/init.d/mysqld

cp support-files/my-default.cnf /etc/my.cnf

2.4.修改启动脚本

vi /etc/init.d/mysqld

2.4.1修改项:

basedir=/usr/local/mysql/

datadir=/usr/local/mysql/data/mysql

2.5.启动服务

service mysqld start

2.6加入环境变量,编辑 /etc/profile,这样可以在任何地方用mysql命令了

export PATH=$PATH:/usr/local/mysql//bin

source /etc/profile

2.7.测试连接

./mysql/bin/mysql -uroot

2.8.启动mysql

service mysqld start

service mysqld status

2.9.创建用户修改root密码并授权

Mysql -uroot -p

set password=password('root');

FLUSH PRIVILEGES;

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

FLUSH PRIVILEGES;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值