本篇內(nèi)容介紹了“Linux CentOS安裝MySQL-8.0.13-linux-glibc2.12-x86_64的過程”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠?qū)W有所成!
成都創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于成都做網(wǎng)站、網(wǎng)站制作、莒縣網(wǎng)絡(luò)推廣、重慶小程序開發(fā)、莒縣網(wǎng)絡(luò)營銷、莒縣企業(yè)策劃、莒縣品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;成都創(chuàng)新互聯(lián)為所有大學生創(chuàng)業(yè)者提供莒縣建站搭建服務(wù),24小時服務(wù)熱線:18982081108,官方網(wǎng)址:jinyejixie.com
//下載 mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz [root@root ~]# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz //解壓mysql [root@root ~]# tar -xJvf mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz …… mysql-8.0.13-linux-glibc2.12-x86_64/bin/myisamchk mysql-8.0.13-linux-glibc2.12-x86_64/bin/myisamlog mysql-8.0.13-linux-glibc2.12-x86_64/bin/myisampack …… //解壓完成 //重命名mysql-8.0.13-linux-glibc2.12-x86_64文件夾為mysql [root@root ~]# mv mysql-8.0.13-linux-glibc2.12-x86_64 mysql //將mysql移到/usr/local/ 目錄下 [root@root ~]# mv /root/mysql /usr/local/ mv:是否覆蓋"/usr/local/mysql"? y //添加mysql用戶組及MySQL用戶 [root@root ~]# groupadd mysql [root@root ~]# useradd -r -g mysql mysql //設(shè)置/usr/local/mysql/文件夾的用戶權(quán)限 [root@root ~]# cd /usr/local/mysql/ [root@root mysql]# chown -R mysql:mysql ./ //新建MySQL數(shù)據(jù)存儲文件夾 [root@root mysql]# mkdir data //初始化mysql數(shù)據(jù)庫,生成默認密碼 [root@root mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ 2018-12-22T05:24:39.603264Z 0 [Warning] [MY-011070] [Server] 'Disablining --skip-symbolic-links (or equivalent) is the default. Consider notas it' is deprecated and will be removed in a future release. 2018-12-22T05:24:39.603444Z 0 [System] [MY-013169] [Server] /usr/localmysqld 8.0.13) initializing of server in progress as process 27519 2018-12-22T05:24:41.891360Z 5 [Note] [MY-010454] [Server] A temporary ed for root@localhost: ePrOX&p>L52# //這是初始默認密碼 2018-12-22T05:24:43.475923Z 0 [System] [MY-013170] [Server] /usr/localmysqld 8.0.13) initializing of server has completed [Server] A temporary password is generated for root@localhost: lqs-.d,fN1pB [root@iZwz9ijcs0cia5xad0sewhZ mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ 2019-07-01T08:42:30.346859Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.16) initializing of server in progress as process 15888 2019-07-01T08:42:33.616199Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: lqs-.d,fN1pB 2019-07-01T08:42:35.006735Z 0 [System] [MY-013170] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.16) initializing of server has completed //設(shè)置數(shù)據(jù)庫存儲文件夾的用戶權(quán)限 [root@root mysql]# chown -R root:root ./ [root@root mysql]# chown -R mysql:mysql data //修改etc/my.cnf配置文件 [root@root ~]# vim /etc/my.cnf //修改為以下內(nèi)容: [mysqld] server-id = 1 port = 3306 bind-address = 0.0.0.0 max_connections = 5000 mysqlx_port = 33060 mysqlx_socket = /tmp/mysqlx.sock basedir = /usr/local/mysql datadir = /usr/local/mysql/data socket = /tmp/mysql.sock pid-file = /tmp/mysqld.pid slow_query_log = ON slow_query_log_file = /usr/local/mysql/logs/slow.log log-error = /usr/local/mysql/logs/error.log long_query_time = 0.2 log-bin = bin.log relay-log = relay.log binlog_format = ROW relay_log_recovery = 1 character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci init_connect ='SET NAMES utf8mb4' innodb_buffer_pool_size = 1G join_buffer_size = 128M sort_buffer_size = 2M read_rnd_buffer_size = 2M log_timestamps = SYSTEM lower_case_table_names = 1 default-authentication-plugin = mysql_native_password 保存退出。 [root@root mysql]# chmod 777 /etc/my.cnf //設(shè)置開機自啟動 [root@root mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql [root@root mysql]# chmod +x /etc/init.d/mysql //注冊查看服務(wù) [root@root mysql]# chkconfig --add mysql [root@root mysql]# chkconfig --list mysql mysql 0:關(guān)閉 1:關(guān)閉 2:啟用 3:啟用 4:啟用 5:啟用 6:關(guān)閉 // /etc/ld.so.conf 這個文件記錄了編譯時使用的動態(tài)鏈接庫的路徑,告訴鏈接器去哪個路徑下尋找鏈接時需要用到的庫,如果找不到,就會提示鏈接錯誤。 如果我們安裝了第三方的庫,而沒有將它放在鏈接器可以找到的目錄,則運行使用這些第三方庫的程序時,會提示找不到庫。 [root@root mysql]# vim /etc/ld.so.cnf 添加如下內(nèi)容: include ld.so.conf.d/*.conf /usr/local/mysql/lib //配置環(huán)境變量 [root@root mysql]# vim /etc/profile 添加如下內(nèi)容: export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib //讓配置文件立馬生效 [root@root mysql]# source /etc/profile //啟動MySQL服務(wù) [root@root mysql]# service mysql start //使用生成的密碼登陸MySQL數(shù)據(jù)庫 [root@root mysql]# mysql -u root -p mysql: [Warning] World-writable config file '/etc/my.cnf' is ignored. Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.13 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. //修改密碼 mysql> alter user 'root'@'localhost' identified by '123456'; Query OK, 0 rows affected (0.13 sec) mysql> exit Bye //退出重登錄mysql [root@root mysql]# mysql -u root -p mysql: [Warning] World-writable config file '/etc/my.cnf' is ignored. Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 8.0.13 MySQL Community Server - GPL Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.01 sec) 到此安裝完成! 這里設(shè)置的 /etc/my.cnf 權(quán)限是777 ,就是任何人都可讀可寫,my.cnf 會被忽略掉,mysql的安全機制,也可以不要my.cnf配置文件。 下面設(shè)置一下MySQL的遠程訪問 簡單寫一下命令,自己寫的時候忘了記錄,網(wǎng)上也是一大堆。 登陸mysql mysql -u root -p use mysql; select host,user from user; CREATE USER 'root'@'%' IDENTIFIED BY '123456'; GRANT ALL ON *.* TO 'root'@'%'; flush privileges; ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER; ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; FLUSH PRIVILEGES; 下面一定要記得關(guān)閉防火墻 service iptables stop 設(shè)置防火墻開機不啟動 chkconfig iptables off 然后關(guān)機重啟,連接試一試吧!
“Linux CentOS安裝mysql-8.0.13-linux-glibc2.12-x86_64的過程”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!
本文題目:LinuxCentOS安裝mysql-8.0.13-linux-glibc2.12-x86_64的過程
轉(zhuǎn)載來于:http://jinyejixie.com/article28/ijggjp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、移動網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站導航、軟件開發(fā)、商城網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)