linux mysql-5.6.26 安裝,linuxmysql-5.6.26

來源:互聯網
上載者:User

linux mysql-5.6.26 安裝,linuxmysql-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表增加新帳號

錯誤:指定了strict 模式,為了安全,strict 模式禁止通過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

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.