CentOS Yum編譯安裝MySQL 5.6
本文實例為大家分享了centos yum安裝mysql 5.6的具體代碼,供大家參考,具體內容如下
1.檢查系統(tǒng)是否安裝其他版本的MYSQL數(shù)據(jù)
#yum list installed | grep mysql #yum -y remove mysql-libs.x86_64
2.安裝及配置
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm # rpm -ivh mysql-community-release-el6-5.noarch.rpm # yum repolist all | grep mysql
安裝MYSQL數(shù)據(jù)庫
# yum install mysql-community-server -y
設置為開機啟動(2、3、4都是on代表開機自動啟動)
# chkconfig --list | grep mysqld # chkconfig mysqld on
3.設置遠程root
啟動mysql
# service mysqld start
設置root密碼
# mysql_secure_installation
登陸root賬號
# mysql -uroot -p
建立遠程root用戶
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你設置的密碼' WITH GRANT OPTION; mysql> flush privileges;
4.設置utf-8編碼
查看mysql原本編碼:
mysql> show variables like 'character%';
設置編碼
# vi /etc/my.cnf
如下(少補):
[mysqld] character-set-server=utf8 collation-server=utf8_general_ci [mysql] default-character-set = utf8 [mysql.server] default-character-set = utf8 [mysqld_safe] default-character-set = utf8 [client] default-character-set = utf8
重啟mysql
# service mysqld restart
再次查看編碼:
# mysql -uroot -p mysql> show variables like 'character%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec)
5.加入環(huán)境變量,編輯 /etc/profile,這樣可以在任何地方用mysql命令
export PATH=$PATH:/usr/local/mysql//bin<br>source /etc/profile
精彩專題分享:mysql不同版本安裝教程 mysql5.7各版本安裝教程 mysql5.6各版本安裝教程
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
- centos6利用yum安裝php mysql gd的步驟
- CentOS 6.5下yum安裝 MySQL-5.5全過程圖文教程
- Centos中徹底刪除Mysql(rpm、yum安裝的情況)
- CentOS 5.4 服務器配置 yum安裝Apache+php+Mysql
- centos下yum搭建安裝linux+apache+mysql+php環(huán)境的方法
- CentOS 7.0下使用yum安裝mysql的方法詳解
- 在CentOS 7下使用yum配置MySQL源并安裝MySQL
- 詳解騰訊云CentOS7.0使用yum安裝mysql及使用遇到的問題
- centos下yum搭建安裝linux+apache+mysql+php環(huán)境教程
- Centos7下使用yum安裝mysql數(shù)據(jù)庫的詳細教程(增強版)
相關文章
error while loading shared libraries xx.so處理方法
一般我們在Linux下執(zhí)行某些外部程序的時候可能會提示找不到共享庫(error while loading shared libraries xx.so)的錯誤2013-04-04Apache中Virtual Host虛擬主機配置及rewrite參數(shù)說明
這篇文章主要介紹了Apache中Virtual Host虛擬主機配置及rewrite模塊中的重要參數(shù)說明,是在同一個Apache服務器軟件上部署多個站點的基礎方法,需要的朋友可以參考下2016-03-03Linux 3.X/4.x/5.x 忘記寶塔面板密碼的解決方法
在本篇文章里我們給大家整理的是關于忘記Linux 3.X/4.x/5.x 寶塔面板密碼的解決方案,有需要的朋友們可以學習下。2019-10-10