yum安装mysql5.6
生活随笔
收集整理的這篇文章主要介紹了
yum安装mysql5.6
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
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設(shè)置為開機啟動(2、3、4都是on代表開機自動啟動)
chkconfig --list | grep mysqld chkconfig mysqld on?
3.設(shè)置遠程root
啟動mysql
service mysqld start設(shè)置root密碼
mysql_secure_installation登陸root賬號
mysql -uroot -p c建立遠程root用戶
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你設(shè)置的密碼' WITH GRANT OPTION; mysql> flush privileges;?
4.設(shè)置utf-8編碼
查看mysql原本編碼:
mysql> show variables like 'character%';設(shè)置編碼
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轉(zhuǎn)載于:https://www.cnblogs.com/yangmingxianshen/p/9377472.html
總結(jié)
以上是生活随笔為你收集整理的yum安装mysql5.6的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java的接口、继承与多态
- 下一篇: 一篇极好的 CSS 教程