解壓縮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" />

国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答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
主站蜘蛛池模板: 国产 欧美 日本 | 国产伦精品一区二区三区高清 | 国产精品1区2区 | 精品日韩欧美 | 伊人色综合一区二区三区 | 在线亚洲精品 | 中文在线第一页 | 国产一区二区三区精品视频 | 久久九九国产 | 日韩v欧美 | 六十路垂乳熟年交尾正在播放 | 亚州一区二区 | 青青色在线视频 | 精品一区二区三区免费视频 | 爱色电影 | 久久精品国产精品亚洲综合 | 欧美性一区二区三区五区 | 久久久久久综合成人精品 | 国产欧美精品区一区二区三区 | 中文字幕在线播放第一页 | 亚洲精品国产字幕久久vr | 日韩欧美在线综合网高清 | 在线欧美色图 | 国产一级一级一级成人毛片 | 香港经典a毛片免费观看…伊人色综合久久 | 国产成人一区二区三区影院免费 | 亚洲欧美另类自拍第一页 | 九九热免费视频 | 最刺激黄a大片免费观看 | 精品国产免费观看一区高清 | 日韩亚洲欧美综合 | 国内精品一区二区在线观看 | 久久精品a一国产成人免费网站 | 国内精品一区二区三区 | 欧美一区二区三区大片 | 河边性xxxxfreexxxxx| 亚洲第一导航 | 欧美a在线播放 | 欧美 日韩 国产 成人 在线观看 | 国产在线一区二区三区四区 | 久久成人国产精品免费 |