linux mysql-5.6.26 安装

王朝学院·作者佚名  2016-05-26
窄屏简体版  字體: 小  |  中  |  大  |  超大  

linux MySQL-5.6.26 安装下载地址ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.6/mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz

解压tar -xzf mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz

注:安装目录需要设置到解压目录,否则报以下错误

FATAL ERROR: Could not find ./bin/my_PRint_defaultsIf you compiled from source, you need to run 'make install' tocopy the software into the correct location ready for Operation.If you are using a binary release, you must either be at the toplevel of the extracted archive, or pass the --basedir optionpointing to that location.

or

FATAL ERROR: Could not find my-default.cnfIf you compiled from source, you need to run 'make install' tocopy the software into the correct location ready for operation.If you are using a binary release, you must either be at the toplevel of the extracted archive, or pass the --basedir optionpointing to that location.

将解压的目录放到/usr/local下改为mysql或添加软连接

mv mysql-5.6.26-linux-glibc2.5-x86_64 mysql

or

ln -s /www/mysql-5.6.26-linux-glibc2.5-x86_64 /usr/local/mysql

增加mysql用户和组groupadd mysqluseradd -r -g mysql mysql

修改mysql目录及子文件属主和属组

chown -R mysql:mysql mysql

进入mysql目录并安装cd mysqlscripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/var/lib/mysql

安装过程可能缺少某些文件,一般用yum install -y xxx按需安装即可.

实现使用service mysqll (start|status|stop)命令操作mysql.

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

错误:

[root@localhost mysql]# mysql-bash: mysql: command not found

解决:配置环境变量,把export PATH=$PATH:/usr/local/mysql/bin添加到/etc/profile中,source /etc/profile重新加载环境变量,service mysql start启动mysql服务。

错误:

[root@localhost mysql]# mysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

解决:

mysql --socket=/var/lib/mysql/mysql.sockln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

启动成功mysql> select version();+-----------+| version() |+-----------+| 5.6.26 |+-----------+1 row in set (0.00 sec)

成功后可能需要往mysql的user表增加新账号错误:指定了严格模式,为了安全,严格模式禁止通过insert 这种形式直接修改mysql库中的user表进行添加新用户

1364 - Field 'ssl_cipher' doesn't have a default value

解决:

vim /usr/local/mysql/my.cnf

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES改为sql_mode=NO_ENGINE_SUBSTITUTION

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航