linux centos7安裝 mysql-5.7.11

來源:互聯網
上載者:User

標籤:

1.下載和解壓mysql資料庫 wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-linux-glibc2.5-x86_64.tar.gzs tar -xvf mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz -C /usr/local/mysql-5.7.11 2.建立軟連結ln -s mysql-5.7.11 mysql  3.建立mysql使用者和修改軟體的許可權    useradd -r -M -s /sbin/nologin mysql    chown -R mysql.mysql  /usr/local/mysql-5.7.11   chown -R mysql.mysql /usr/local/mysql    chgrp -R mysql /usr/local/mysql-5.7.11 4.安裝和初始化資料庫    cd /usr/local/mysql-5.7.11/    bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.7.11/ --datadir=/usr/local/mysql-5.7.11/data/            --必須在mysql根目錄安裝mysql,否則出錯    cp -a ./support-files/my-default.cnf  /etc/my.cnf    cp -a ./support-files/mysql.server  /etc/init.d/mysqld   修改/etc/my.cnf  basedir = /usr/local/mysql-5.7.11     datadir = /usr/local/mysql-5.7.11/data       port = 3306    #cd bin/   #./mysqld_safe --user=mysql &       [[email protected] scripts]# /etc/init.d/mysqld restart   Shutting down MySQL..                                      [  OK  ]   Starting MySQL...                                          [  OK  ] 關閉是 /etc/init.d/mysqld stop   #開機啟動  chkconfig --level 35 mysqld on 5.初始化密碼 mysql5.7會產生一個初始化密碼,而在之前的版本首次登陸不需要登入。 shell> cat /root/.mysql_secret  ./mysql -uroot -p  SET PASSWORD = PASSWORD(‘root‘);flush privileges 開放存取權限 

[[email protected]_199_194_centos bin]# mysql -uroot -proot


MySQL [(none)]> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘root‘ WITH GRANT OPTION;


MySQL [(none)]>  flush privileges;

  

linux centos7安裝 mysql-5.7.11

相關文章

聯繫我們

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