總結了一下網上MySQL 5.6.26 利用tar.gz包安裝的MysSQL資料庫會遇到的問題

來源:互聯網
上載者:User

標籤:

總結了一下網上MySQL 5.6.26 利用tar.gz包安裝的MysSQL資料庫會遇到的問題
   

安裝包:
Linux Generic
mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz
安裝環境:
CentOS 7

 

     這個資料庫照理說應該沒什麼難度,但是還是糾結了兩天。中文亂碼問題,資料庫服務restart報缺失.pid檔案問題。處理過程在這裡做個小的總結,以便以後工作中需要方便查閱。
       1、建立mysql組和mysql使用者;
           [[email protected] ~]# groupadd mysql
           [[email protected] ~]# useradd -g mysql mysql

       2、將擷取的tar.gz包解壓至/usr/local/目錄下;
           [[email protected] ~]# tar -zxvf/data/mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz
           [[email protected] ~]# cp /data/mysql-5.6.26-linux-glibc2.5-x86_64//usr/local/

       3、改名,方便今後使用;
           [[email protected] local]# mv mysql-5.6.26-linux-glibc2.5-x86_64/mysql/

      4、修改mysql目錄的許可權;
           [[email protected] local]# chown -R mysql:mysqlmysql

       5、安裝;
           [[email protected] mysql]# ./scripts/mysql_install_db--user=mysql --basedir=/usr/local/mysql--datadir=/usr/local/mysql/data

       6、修改資料庫預設編碼;
           [[email protected] mysql]# vi my.cnf
            在[mysqld]後面加入
           character_set_server=utf8
            儲存退出
           [[email protected] mysql]# cd support-files/
           [[email protected] support-files]# vi my-default.cnf
            同樣在[mysqld]後面加入
           character_set_server=utf8
            儲存退出

         7、配置各種系統參數
           [[email protected] support-files]# cp my-default.cnf /etc/my.cnf
           [[email protected] support-files]# cp mysql.server/etc/rc.d/init.d/mysql
           [[email protected] support-files]# vi /etc/profile            添加以下內容
            export MYSQL_HOME="/usr/local/mysql"
            export PATH="$PATH:$MYSQL_HOME/bin"            儲存退出           [[email protected] support-files]# source /etc/profile
         8、添加自啟動服務           [[email protected] support-files]# chkconfig --add mysql           [[email protected] support-files]# chkconfig mysql on         9、啟動mysql           [[email protected] support-files]# service mysql start         10、登入mysql及改密碼與配置遠端存取           [[email protected] support-files]# mysqladmin -u root password‘your_password‘    #修改root使用者密碼           [[email protected] support-files]# mysql -u root -p    #登入mysql,需要輸入密碼           mysql>GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY‘your_password‘ WITH GRANT OPTION;    #允許root使用者遠端存取           mysql>FLUSHPRIVILEGES;    #重新整理許可權           mysql>exit

總結了一下網上MySQL 5.6.26 利用tar.gz包安裝的MysSQL資料庫會遇到的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.