解壓縮MySQL [html] [root@localhost test]# tar -xvf MySQL-5.6.12-2.linux_glibc2.5.i386.rpm-bundle.tar MySQL-test-5.6.12-2.linux_glibc2.5.i386.rpm My" />

<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        MySQL安裝過程中出現的問題_MySQL

        來源:懂視網 責編:小采 時間:2020-11-09 18:43:28
        文檔

        MySQL安裝過程中出現的問題_MySQL

        MySQL安裝過程中出現的問題_MySQL:bitsCN.com MySQL安裝過程中出現的問題 1>解壓縮MySQL [html] [root@localhost test]# tar -xvf MySQL-5.6.12-2.linux_glibc2.5.i386.rpm-bundle.tar MySQL-test-5.6.12-2.linux_glibc2.5.i386.rpm My
        推薦度:
        導讀MySQL安裝過程中出現的問題_MySQL:bitsCN.com MySQL安裝過程中出現的問題 1>解壓縮MySQL [html] [root@localhost test]# tar -xvf MySQL-5.6.12-2.linux_glibc2.5.i386.rpm-bundle.tar MySQL-test-5.6.12-2.linux_glibc2.5.i386.rpm My

        bitsCN.com

        MySQL安裝過程中出現的問題

        1>解壓縮MySQL

        [html] [root@localhost test]# tar -xvf MySQL-5.6.12-2.linux_glibc2.5.i386.rpm-bundle.tar MySQL-test-5.6.12-2.linux_glibc2.5.i386.rpm MySQL-shared-5.6.12-2.linux_glibc2.5.i386.rpm MySQL-embedded-5.6.12-2.linux_glibc2.5.i386.rpm MySQL-client-5.6.12-2.linux_glibc2.5.i386.rpm MySQL-devel-5.6.12-2.linux_glibc2.5.i386.rpm MySQL-server-5.6.12-2.linux_glibc2.5.i386.rpm MySQL-shared-compat-5.6.12-2.linux_glibc2.5.i386.rpm 

        2>安裝MySQL

        [html]

        (1) 如果已經安裝了MySQL,會出現以下提示信息:

        [root@localhost test]# rpm -ivh MySQL-server-5.6.12-2.linux_glibc2.5.i386.rpm Preparing... ########################################### [100%] package MySQL-server-5.6.12-2.linux_glibc2.5.i386 is already installed [root@localhost test]# rpm -ivh MySQL-client-5.6.12-2.linux_glibc2.5.i386.rpm Preparing... ########################################### [100%] package MySQL-client-5.6.12-2.linux_glibc2.5.i386 is already installed 

        可以先進行卸載MySQL

        使用命令rpm –e MySQL-server-5.6.12-2.linux_glibc2.5.i386.rpm –nodeps

        [html] rpm –e MySQL-server-5.6.12-2.linux_glibc2.5.i386.rpm --nodeps 

        (2)如果沒有提示這些信息,那么會正常安裝.

        [html] [root@localhost test]# rpm -ivh MySQL-server-5.6.12-2.linux_glibc2.5.i386.rpm Preparing... ########################################### [100%] 1:MySQL-server ########################################### [100%] [root@localhost test]# rpm -ivh MySQL-client-5.6.12-2.linux_glibc2.5.i386.rpm Preparing... ########################################### [100%] 1:MySQL-client ########################################### [100%] 

        3>啟動MySQL

        (1)首次啟動MySQL服務器,出現異常信息的解決辦法

        [html] [root@localhost test]# service mysql start Starting MySQL.......................... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.pid). 

        由于mysql啟動的僵死進程,需要將其殺死之后方能啟動

        [html] [root@localhost test]# ps -ef | grep mysql root 1953 1 0 22:18 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid mysql 2171 1953 0 22:18 ? 00:00:04 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/lib/mysql/localhost.localdomain.err --pid-file=/var/lib/mysql/localhost.localdomain.pid root 3282 1 0 22:37 pts/0 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.pid mysql 3386 3282 2 22:37 pts/0 00:00:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/lib/mysql/localhost.err --pid-file=/var/lib/mysql/localhost.pid root 3482 2681 0 22:38 pts/0 00:00:00 grep mysql 

        使用kill -9 2171之類殺死

        再使用service mysql start或者/etc/init.d/mysql start

        [html] [root@localhost test]# service mysql start Starting MySQL SUCCESS! 

        4>登錄MySQL

        [html] [root@localhost test]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or /g. Your MySQL connection id is 2 Server version: 5.6.12 MySQL Community Server (GPL) Copyright (c) 2000, 2013, 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_secret中

        [html] cat .mysql_secret 進入mysql之后需要設置密碼,否則不能進行任何操作,如果提示ERROR 1862 (HY000): Your password has expired. To log in you mustchange it using a client that supports expired passwords. /

        那么也需要重新設置密碼

        MySQL文檔中詞條MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS有下面的信息

        查找SET PASSWORD

        為root用戶設置新密碼

        [html] set password for ‘root’@’localhost’=password(‘root’) 

        之后可以進行正常的操作

        忘記mysql root密碼的解決方法

        一. MySQL密碼的恢復方法之一

        如果忘記了MySQL的root密碼,可以用以下方法重新設置:

        1. KILL掉系統里的MySQL進程;[html] killall -TERM mysqld 2. 用以下命令啟動MySQL,以不檢查權限的方式啟動;[html] safe_mysqld --skip-grant-tables & 3. 然后用空密碼方式使用root用戶登錄 MySQL;[html] mysql -u root 4. 修改root用戶的密碼;[html] mysql> update mysql.user set password=PASSWORD('新密碼') where User='root'; mysql> flush privileges; mysql> quit 

        重新啟動MySQL,就可以使用新密碼登錄了。

        二. MySQL密碼的恢復方法二

        有可能你的系統沒有 safe_mysqld 程序(比如我現在用的 ubuntu操作系統, apt-get安裝的mysql) , 下面方法可以恢復

        1. 停止mysqld;

        [html] /etc/init.d/mysql stop 

        (您可能有其它的方法,總之停止mysqld的運行就可以了)

        2. 用以下命令啟動MySQL,以不檢查權限的方式啟動;

        [html] mysqld --skip-grant-tables & 

        3. 然后用空密碼方式使用root用戶登錄 MySQL;

        mysql -u root

        4. 修改root用戶的密碼;

        [html] mysql> update mysql.user set password=PASSWORD('newpassword') where User='root'; mysql> flush privileges; mysql> quit 

        重新啟動MySQL

        [html] /etc/init.d/mysql restart 

        就可以使用新密碼 newpassword 登錄了

        mysql The server quit without updating PID file異常解決辦法

        安裝好mysql后,用

        Java代碼

        /usr/local/mysql/bin/mysqld_safe &

        去啟動mysql,總是處于僵死狀態,后來去suport_files 用mysql.server start 來啟動,

        提示mysql The server quit without updating PID file。在網上找了下,原來說是有mysql

        啟動的僵死進程。

        用ps -ef |grep mysql 發現有

        Php代碼 root 4507 1 0 21:40 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql mysql 4793 4507 0 21:40 ? 00:00:03 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql....... 

        于是kill 4793,再啟動。就正常了

        ps:kill root下的進程4507是沒

        Mysql報錯的解決'Can't connect to local MySQL server through socket '/tmp/mysql.sock'

        [root@localhost mysql]# mysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)[root@localhost mysql]# service mysqld restart 這里說明mysqld并沒有啟動,MySQL manager or server PID file could not be found! [FAILED]Starting MySQL/etc/init.d/mysqld: line 159: kill: (18977) - No such process [FAILED][root@localhost mysql]# cd bin[root@localhost bin]# ./mysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) 這里就說了不能通過/tmp/mysql.sock連接數據庫。[root@localhost bin]# cd /tmp 進去檢查,看到有這個文件,所以看別的原因。[root@localhost tmp]# lsgconfd-root mapping-root mysql.sock mysql-test-ports mysql-test-ports.sem scim-panel-socket:0-root VMwareDnD vmware-root vmware.txt[root@localhost tmp]# cd /usr/local/mysql/[root@localhost mysql]# pwd/usr/local/mysql[root@localhost mysql]# chown -R root:mysql . 忽然想起來了沒有設置權限呢,開始設置權限[root@localhost mysql]# lltotal 36drwxr-xr-x 2 root mysql 4096 Nov 28 21:51 bindrwxr-xr-x 3 root mysql 4096 Nov 28 21:50 includedrwxr-xr-x 2 root mysql 4096 Nov 28 21:50 infodrwxr-xr-x 3 root mysql 4096 Nov 28 21:50 libdrwxr-xr-x 2 root mysql 4096 Nov 28 21:51 libexecdrwxr-xr-x 4 root mysql 4096 Nov 28 21:50 mandrwxr-xr-x 8 root mysql 4096 Nov 28 21:51 mysql-testdrwxr-xr-x 3 root mysql 4096 Nov 28 21:50 sharedrwxr-xr-x 5 root mysql 4096 Nov 28 21:50 sql-bench[root@localhost mysql]# chown -R mysql /var/lib/mysql[root@localhost mysql]# cp share/mysql/my-huge.cnf /etc/my.cnf[root@localhost mysql]# cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld[root@localhost mysql]# chmod 755 /etc/rc.d/init.d/mysqld[root@localhost mysql]# chkconfig --add mysqld[root@localhost mysql]# chkconfig --level 345 mysqld on=======error========[root@localhost mysql]# mysqladmin -u root password 'uplooking'mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)'Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists! 又是上邊一樣的錯誤[root@localhost mysql]# bin/mysql startERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)[root@localhost mysql]# /etc/rc.d/init.d/mysqld statusMySQL is not running, but lock exists [FAILED] 這里說的是沒有運行著mysql,但是還在鎖定。這時候我看到了下邊那篇文章,重新檢查了一遍權限,[root@localhost mysql]# chown -R mysql:mysql /var/lib/mysql 在這里,我原來設置的時候這個組沒有設置,只寫了chown -R mysql /var/lib/mysql,分組被我忽略掉了,哎,折騰這么長時間。[root@localhost mysql]# /etc/rc.d/init.d/mysqld start 從這里,mysql啟動正常了Starting MySQL [ OK ][root@localhost mysql]# /etc/rc.d/init.d/mysqld stopShutting down MySQL [ OK ][root@localhost mysql]#[root@localhost mysql]# mysqladmin -u root password 'uplooking' 這里是說服務器沒有啟動mysqladmin: connect to server at 'localhost' failederror: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists![root@localhost mysql]# /etc/rc.d/init.d/mysqld start 啟動服務器Starting MySQL [ OK ][root@localhost mysql]# mysqladmin -u root password 'uplooking' 添加root密碼[root@localhost mysql]# mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)[root@localhost mysql]# mysql -u root -p 用root密碼登陸,測試。Enter password:Welcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 3Server version: 5.0.56-Comsenz-log SourceType 'help;' or '/h' for help. Type '/c' to clear the buffer.mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || test |+--------------------+3 rows in set (0.00 sec)mysql> quitBye[root@localhost mysql]# service mysqld restartShutting down MySQL [ OK ]Starting MySQL [ OK ][root@localhost mysql]#====權限的驗證測試====[root@localhost mysql]# cd /tmp[root@localhost tmp]# mkdir test[root@localhost tmp]# cd test[root@localhost test]# ls[root@localhost test]# touch 11[root@localhost test]# lltotal 0-rw-r--r-- 1 root root 0 Nov 28 22:37 11[root@localhost test]# chown -R mysql 11[root@localhost test]# lltotal 0-rw-r--r-- 1 mysql root 0 Nov 28 22:37 11[root@localhost test]#=========================

        bitsCN.com

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        MySQL安裝過程中出現的問題_MySQL

        MySQL安裝過程中出現的問題_MySQL:bitsCN.com MySQL安裝過程中出現的問題 1>解壓縮MySQL [html] [root@localhost test]# tar -xvf MySQL-5.6.12-2.linux_glibc2.5.i386.rpm-bundle.tar MySQL-test-5.6.12-2.linux_glibc2.5.i386.rpm My
        推薦度:
        標簽: 安裝 問題 時出現
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲精品你懂的在线观看| 二级毛片免费观看全程| 无码日韩精品一区二区免费暖暖| 免费一级做a爰片久久毛片潮喷| 亚洲 日韩经典 中文字幕| 免费国产作爱视频网站| 亚洲精品mv在线观看| 免费成人福利视频| 亚洲乱人伦精品图片| 青青青国产在线观看免费网站 | 四虎影视成人永久免费观看视频 | 黄色一级毛片免费看| 国产精品va无码免费麻豆| 婷婷亚洲综合一区二区 | 国产亚洲色视频在线| 国产日韩在线视频免费播放| 在线精品亚洲一区二区小说| 两个人看的www高清免费观看| 久久精品国产亚洲AV麻豆~| 2021精品国产品免费观看 | 亚洲AV日韩AV天堂一区二区三区| 国产成人久久AV免费| 亚洲喷奶水中文字幕电影| 成年午夜视频免费观看视频| 亚洲色偷精品一区二区三区| 可以免费观看一级毛片黄a| 一级做受视频免费是看美女| 亚洲av色影在线| 成人最新午夜免费视频| 黄色一级毛片免费| 精品亚洲麻豆1区2区3区| 成年女人免费视频播放77777 | 豆国产96在线|亚洲| 亚洲精品高清国产一线久久| 最近免费视频中文字幕大全| 亚洲日本天堂在线| 一本色道久久综合亚洲精品| 国产精品入口麻豆免费观看| 国产亚洲视频在线| 亚洲视频一区在线观看| 国产午夜影视大全免费观看|