背景:
閱讀新聞
11.2.0.3 ASM實(shí)例出現(xiàn)ORA-4031錯誤導(dǎo)致數(shù)據(jù)庫歸檔失敗
[日期:2014-03-03]
來源:Linux社區(qū)
作者:wuweilong
[字體:大 中 小]
環(huán)境:
平臺:RedHat EnterPrise 5.8 X86_X64
數(shù)據(jù)庫:Oracle EnterPrise 11.2.0.3
集群軟件:Oracle grid 11.2.0.3
故障現(xiàn)象:
數(shù)據(jù)庫出現(xiàn)了歸檔失敗,其中有一個節(jié)點(diǎn)的實(shí)例出現(xiàn)HANG死的狀況。
日志信息如下:
Fri Feb 28 19:49:04 2014
ARC1: Error 19504 Creating archive log file to '+DATA02'
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance orcl1 - Archival Error
ORA-16038: log 14 sequence# 68244 cannot be archived
ORA-19504: failed to create file ""
ORA-00312: online log 14 thread 1: '+DATA02/九度快排系統(tǒng) https://www.190seo.comorcl/onlinelog/group_14.264.792274883'
ORA-00312: online log 14 thread 1: '+DATA02/orcl/onlinelog/group_14.265.792274889'
Archiver process freed from errors. No longer stopped
Fri Feb 28 19:50:22 2014
ARC0: LGWR is actively archiving destination LOG_ARCHIVE_DEST_3
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance orcl1 - Archival Error
ORA-16014: log 14 sequence# 68244 not archived, no available destinations
ORA-00312: online log 14 thread 1: '+DATA02/orcl/onlinelog/group_14.264.792274883'
ORA-00312: online log 14 thread 1: '+DATA02/orcl/onlinelog/group_14.265.792274889'
ARC0: Archive log rejected (thread 1 sequence 68240) at host 'orclsh'
FAL[server, ARC0]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
ORACLE Instance orcl1 - Archival Error. Archiver continuing.
分析:
由于歸檔失敗發(fā)生在ASM磁盤上,首先檢查ASM磁盤空間以及DB_RECOVERY_FILE_DEST_SIZE,ASM磁盤空間是足夠的,而且由于只有一個節(jié)點(diǎn)出現(xiàn)出現(xiàn)了無法歸檔的問題,也可以排除是空間不足造成的。確認(rèn)兩個節(jié)點(diǎn)的DB_RECOVERY_FILE_DEST_SIZE參數(shù)設(shè)置都是0,基本上可以判斷問題和當(dāng)前節(jié)點(diǎn)的ASM實(shí)例狀態(tài)不正常有關(guān)。
檢查ASM實(shí)例的錯誤信息:
Fri Feb 28 19:41:23 2014
Dumping diagnostic data in directory=[cdmp_20130702164115], requested by (instance=2, osid=2032294 (LMD0)), summary=[incident=165521].
Fri Feb 28 19:49:19 2014
Dumping diagnostic data in directory=[cdmp_20130702164845], requested by (instance=2, osid=2032294 (LMD0)), summary=[incident=165522].
Fri Feb 28 19:55:56 2014
Dumping diagnostic data in directory=[cdmp_20130702165517], requested by (instance=2, osid=2032294 (LMD0)), summary=[incident=165523].
當(dāng)前節(jié)點(diǎn)ASM實(shí)例出現(xiàn)了的這個信息,說明報錯發(fā)生在實(shí)例2上:
Fri Feb 28 18:34:25 2014
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_lmd0_2032294.trc (incident=186256):
ORA-04031: unable to allocate 3768 bytes of shared memory ("shared pool","unknown object","sga heap(1,0)","ges enqueues")
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Insufficient shared pool to allocate a GES object (ospid 2032294)
Fri Feb 28 18:29:53 2014
Sweep [inc][186256]: completed
Fri Feb 28 18:36:49 2014
Errors in file /u01/app/grid/diag/asm/+asm/+ASM2/trace/+ASM2_lmd0_2032294.trc (incident=186257):
ORA-04031: unable to allocate 3768 bytes of shared memory ("shared pool","unknown object","sga heap(1,0)","ges enqueues")
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Insufficient shared pool to allocate a GES object (ospid 2032294)
12下一頁
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file ORA-01110: 解決方法
Oracle密碼忘記簡單處理辦法
相關(guān)資訊
ASM實(shí)例 ORA-4031
Win遠(yuǎn)程Linux下的ASM實(shí)例 (01月12日)
11G RAC重建ASM實(shí)例的SPFILE (06/18/2014 13:02:58)
Oracle 10g R2創(chuàng)建ASM實(shí)例Step By (05/16/2014 09:13:50)
ORA-4031錯誤 解決方法 (07/21/2015 14:16:15)
ASM實(shí)例和管理 (05/26/2014 17:17:28)
11.2環(huán)境ASM實(shí)例spfile放在ASM磁盤 (05/16/2014 09:11:42)
本文評論
查看全部評論 (0)
表情:
姓名:
匿名
字?jǐn)?shù)
同意評論聲明
評論聲明
尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)
承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任
本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容
本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評論
參與本評論即表明您已經(jīng)閱讀并接受上述條款
最新資訊
Oracle官方并行邏輯備份工具mysqlpump
MySQL 5.7 mysqlpump 備份工具說明
MySQL5.7.11 mysqlpump 多線程邏輯備份工具
MySQL 5.6 XtraBackup 全量和增量的備份和
基于XtraBackup 2.3.5 的 MySQL全量備份與
Chrome OS 現(xiàn)可支持簡易密碼解鎖
NSA的代碼遭到教授的嘲笑
Fedora 25將默認(rèn)使用Wayland
Nagios 監(jiān)控 SNMP 溫度計
JavaScript函數(shù)定義與函數(shù)作用域詳解
背景:
閱讀新聞
Oracle密碼忘記簡單處理辦法
[日期:2014-03-03]
來源:Linux社區(qū)
作者:wuweilong
[字體:大 中 小]
一、忘記除SYS、SYSTEM用戶之外的用戶的登錄密碼。
用sys或system用戶登錄,執(zhí)行修改數(shù)據(jù)庫密碼
#sqlplus sys/Oracle@"sid" as sysdba
使用如下語句修改用戶的密碼:
SQL> alter user "username" identified by "newpass";
注意:密碼不能全是數(shù)字。并且不能是數(shù)字開頭。否則會出現(xiàn):ORA-00988:口令缺失或無效
二、忘記SYS用戶,或者是SYSTEM用戶的密碼。
如果是忘記system/sys密碼,且人就在數(shù)據(jù)庫服務(wù)器旁邊,可以可以通過本地驗(yàn)證方式登錄,執(zhí)行如下操作:
$ sqlplus / as sysdba
SQL> alter user "username" identified by "newpass";
更多Oracle相關(guān)信息見Oracle 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=12
11.2.0.3 ASM實(shí)例出現(xiàn)ORA-4031錯誤導(dǎo)致數(shù)據(jù)庫歸檔失敗
MySQL導(dǎo)入sql文件錯誤#1044 - Access denied for user 'root'@'localhost'
相關(guān)資訊
Oracle密碼忘記 Oracle sys密碼忘記
本文評論
查看全部評論 (0)
表情:
姓名:
匿名
字?jǐn)?shù)
同意評論聲明
評論聲明
尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)
承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任
本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容
本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評論
參與本評論即表明您已經(jīng)閱讀并接受上述條款
最新資訊
Oracle官方并行邏輯備份工具mysqlpump
MySQL 5.7 mysqlpump 備份工具說明
MySQL5.7.11 mysqlpump 多線程邏輯備份工具
MySQL 5.6 XtraBackup 全量和增量的備份和
基于XtraBackup 2.3.5 的 MySQL全量備份與
Chrome OS 現(xiàn)可支持簡易密碼解鎖
NSA的代碼遭到教授的嘲笑
Fedora 25將默認(rèn)使用Wayland
Nagios 監(jiān)控 SNMP 溫度計
JavaScript函數(shù)定義與函數(shù)作用域詳解
背景:
閱讀新聞
MySQL導(dǎo)入sql文件錯誤#1044 - Access denied for user 'root'@'localhost'
[日期:2014-03-03]
來源:Linux社區(qū)
作者:moqiang
[字體:大 中 小]
在我的個人知識管理中,經(jīng)常用到mysql數(shù)據(jù)庫,wordpress搭建的worklog、搜索測試數(shù)據(jù)、我blog的測試環(huán)境等。我在自己的電腦上整了WAMP(Windows Apache MySQL PHP),哈哈,不是LAMP,用linux做桌面和周圍的同事溝通還是不順暢。
換了臺新的筆記本,原來的mysql被我dump成一個sql文件,50多M。結(jié)果在新系統(tǒng)里面導(dǎo)入的時候出現(xiàn)問題,在命令行執(zhí)行source的時候報錯:
ERROR 1044 (42000): Access denied for user ‘root’@'localhost’ to database ‘information_schema’
以前從來沒遇到過,root帳號沒有權(quán)限?用客戶端、phpmyadmin啥的執(zhí)行操作都沒問題,命令行也能執(zhí)行諸如創(chuàng)建、刪除數(shù)據(jù)庫和表的操作,怪!搜索了幾把,沒找到問題所在,問了幾個周圍的朋友,也沒有解決這個問題。于是作罷,打算用拷貝文件的方式了。剛才又折騰了一下,結(jié)果發(fā)現(xiàn)原來dump的sql文件里有創(chuàng)建和導(dǎo)入information_schema和mysql兩個數(shù)據(jù)庫的內(nèi)容,乖乖!原來我dump的時候把所有數(shù)據(jù)庫所有表的整出來了。顯然這兩個數(shù)據(jù)庫是不能被導(dǎo)入的,手動用editplus打開sql文件,刪除那堆東西以后,導(dǎo)入成功。
記得在mysql4的時代這么干好像是可以的。有時間得多熟悉熟悉了,兩眼一摸黑的蠻干不行了。
mysql -u root -p
輸入密碼
source sql文件名
**************************************************************
或者在導(dǎo)出數(shù)據(jù)庫的sql文件時,先選中進(jìn)入該數(shù)據(jù)庫,然后再選擇【導(dǎo)出】,這樣就不會包含information_schema和mysql兩個數(shù)據(jù)庫的內(nèi)容了,這樣做的話,在重新導(dǎo)入sql文件時,要先創(chuàng)建該數(shù)據(jù)庫,然后進(jìn)入此數(shù)據(jù)庫,再選擇導(dǎo)入sql文件。
Oracle密碼忘記簡單處理辦法
phpMyAdmin提示“Access denied for user 'root'@'localhost' (using password: NO)”的解決辦法
相關(guān)資訊
MySQL錯誤
MySQL出現(xiàn)data too long for (02月13日)
錯誤代碼:2013 Lost connection (05/27/2015 10:24:23)
MySQL碰到“Every derived table (01/05/2015 08:17:14)
MySQL錯誤代碼大全 (12/28/2015 17:08:43)
Linux下MySQL出現(xiàn)#1036 – Table (01/21/2015 15:49:51)
MySQL遇到Too many connections的 (03/05/2014 11:48:37)
本文評論
查看全部評論 (0)
表情:
姓名:
匿名
字?jǐn)?shù)
同意評論聲明
評論聲明
尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)
承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任
本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容
本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評論
參與本評論即表明您已經(jīng)閱讀并接受上述條款
最新資訊
Oracle官方并行邏輯備份工具mysqlpump
MySQL 5.7 mysqlpump 備份工具說明
MySQL5.7.11 mysqlpump 多線程邏輯備份工具
MySQL 5.6 XtraBackup 全量和增量的備份和
基于XtraBackup 2.3.5 的 MySQL全量備份與
Chrome OS 現(xiàn)可支持簡易密碼解鎖
NSA的代碼遭到教授的嘲笑
Fedora 25將默認(rèn)使用Wayland
Nagios 監(jiān)控 SNMP 溫度計
JavaScript函數(shù)定義與函數(shù)作用域詳解
背景:
閱讀新聞
phpMyAdmin提示“Access denied for user 'root'@'localhost' (using password: NO)”的解決辦法
[日期:2014-03-03]
來源:Linux社區(qū)
作者:Linux
[字體:大 中 小]
一、錯誤內(nèi)容
:
$cfg['Servers'][$i]['user']='root';
$cfg['Servers'][$i]['password']='';
操作過程:
打開phpmyadmin——>用戶——>(root-localhost)-編輯權(quán)限
如果設(shè)置了使用密碼的話那么下面的登入密碼也需要同時修改,否則只能改配置文件config.inc.php是沒用的。由于默認(rèn)密碼是空的,后來加上就連接拒絕了,現(xiàn)在再看到剛才那兩行代碼就是登入信息里的用戶名和密碼:
$cfg['Servers'][$i]['user']='root';
$cfg['Servers'][$i]['password']='';
如果留空那那么錯誤提示里就是(using password: NO),如果你把改過的密碼敲上去,那么就可以登錄成功了。
phpMyAdmin 的詳細(xì)介紹:請點(diǎn)這里
phpMyAdmin 的下載地址:請點(diǎn)這里
推薦閱讀:
Ubuntu 13.04 安裝 LAMP\Vsftpd\Webmin\phpMyAdmin 服務(wù)及設(shè)置 http://www.linuxidc.com/Linux/2013-06/86250.htm
LAMP架構(gòu)協(xié)同應(yīng)用的實(shí)例——phpMyAdmin http://www.linuxidc.com/Linux/2013-07/87645.htm
LAMP應(yīng)用之phpMyAdmin、Wordpress http://www.linuxidc.com/Linux/2013-04/82757.htm
phpMyAdmin老出現(xiàn)登陸超時解決方法 http://www.linuxidc.com/Linux/2012-09/70715.htm
Ubuntu 安裝phpMyAdmin與Adminer http://www.linuxidc.com/Linux/2012-08/69419.htm
在LAMP基礎(chǔ)上實(shí)現(xiàn)SSL功能并安裝phpMyAdmin http://www.linuxidc.com/Linux/2012-07/66905.htm
MySQL導(dǎo)入sql文件錯誤#1044 - Access denied for user 'root'@'localhost'
CentOS下MySQL安裝配置過程詳解
相關(guān)資訊
PhpMyAdmin
使用Nginx搭建phpMyAdmin (今 11:50)
CentOS 7.3下phpMyAdmin安裝部署 (08月01日)
Ubuntu 16.04 LTS安裝Apache2+PHP7 (02月01日)
CentOS 7.2 編譯安裝方式搭建 (09月09日)
使用phpMyAdmin瀏覽庫結(jié)構(gòu)很卡的問 (04月13日)
Ubuntu 16.04安裝phpMyAdmin數(shù)據(jù)庫 (11/24/2016 08:22:37)
本文評論
查看全部評論 (0)
表情:
姓名:
匿名
字?jǐn)?shù)
同意評論聲明
評論聲明
尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)
承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任
本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容
本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評論
參與本評論即表明您已經(jīng)閱讀并接受上述條款
最新資訊
使用Nginx搭建phpMyAdmin
MySQL高可用解決方案:MHA
MySQL的異步復(fù)制和半同步復(fù)制
CentOS 7.2 部署Haproxy 1.7.2
Keepalived實(shí)現(xiàn)高可用
Zabbix部署-LNMP環(huán)境
MySQL主從復(fù)制詳解
MySQL雙主復(fù)制詳解
谷歌 Duo 將要成為 Android 系統(tǒng)的
MySQL-MMM高可用方案
背景:
閱讀新聞
CentOS下MySQL安裝配置過程詳解
[日期:2014-03-03]
來源:Linux社區(qū)
作者:Linux
[字體:大 中 小]
1、CentOS下安裝MySQL
[root@sample ~]# yum -y install mysql-server ← 安裝MySQL
然后,安裝PHP訪問MySQL數(shù)據(jù)庫的工具“php-mysql”
[root@sample ~]# yum -y install php-mysql ← 安裝php-mysql
2、配置MySQL
[root@sample ~]# vi /etc/my.cnf ← 編輯MySQL的配置文件
#定位到這里
[client]
#password=your_password
port=3306
socket=/tmp/mysql.sock
default-character-set=utf8
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1 ← 找到這一行,在這一行的下面添加新的規(guī)則,讓MySQL的默認(rèn)編碼 為UTF-8(假若找不到,就在本文件到底添加)
default-character-set=utf8 ← 添加這一行
啟動MySQL服務(wù),進(jìn)入MySQL里面運(yùn)行status查看是否已經(jīng)全部都是支持了utf8,并讓MySQL在系統(tǒng)重新啟動后隨系統(tǒng)自動啟動。
[root@sample ~]# chkconfig mysqld on ← 設(shè)置MySQL服務(wù)隨系統(tǒng)啟動自啟動
[root@sample ~]# chkconfig --list mysqld ← 確認(rèn)MySQL自啟動
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off ← 如果2--5為on的狀態(tài)就OK
[root@sample ~]# service mysqld start ← 啟動MySQL服務(wù)
3、設(shè)置root用戶密碼及相關(guān)優(yōu)化配置
MySQL在剛剛被安裝的時候,它的root用戶是沒有被設(shè)置密碼的,首先來設(shè)置MySQL的root密碼。
[root@sample ~]# mysql -u root ← 用root用戶登錄MySQL服務(wù)器
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select user,host,password from mysql.user; ← 查看用戶信息
+------+------------------------------+---------------+
| user | host | password |
+------+------------------------------+---------------+
| root | localhost | | ← root密碼為空
| root | sample.centospub.com | | ← root密碼為空
| | sample.centospub.com | |
| | localhost | |
+------+------------------------------+---------------+
4 rows in set (0.00 sec)
mysql> set password for root@localhost=password('yournewpwd'); ← 設(shè)置root密碼
Query OK, 0 rows affected (0.01 sec)
mysql> set password for root@'sample.centospub.com'=password('newID'); ← 設(shè)置root密碼
Query OK, 0 rows affected (0.01 sec)
mysql> select user,host,password from mysql.user; ← 查看用戶信息
+------+--------------------------------+--------------------------+
| user | host | password |
+------+--------------------------------+--------------------------+
| root | localhost | 19b68057189b027f | ← root密碼被設(shè)置,已經(jīng)加密
| root | sample.centospub.com | 19b68057189b027f | ← root密碼被設(shè)置,已經(jīng)加密
| | sample.centospub.com | |
| | localhost | |
+------+--------------------------------+--------------------------+
4 rows in set (0.01 sec)
mysql> exit ← 退出MySQL服務(wù)器
Bye
然后,測試一下root密碼有沒有生效。
[root@sample ~]# mysql -u root ← 通過空密碼用root登錄
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) ← 出現(xiàn)此錯誤信息說明密碼設(shè)置成功
[root@localhost ~] # mysql -u root -h sample.centospub.com ← 通過空密碼用root登錄
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) ← 出現(xiàn)此錯誤信息說明密碼設(shè)置成功
[root@sample ~]# mysql -u root -p ← 通過密碼用root登錄
Enter password: ← 在這里輸入密碼
Welcome to the MySQL monitor. Commands end with ; or \g. ← 確認(rèn)用密碼能夠成功登錄
Your MySQL connection id is 5 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> exit
[root@sample ~]# mysql -u root -h sample.centospub.com -p ← 通過密碼用root登錄
Enter password: ← 在這里輸入密碼
Welcome to the MySQL monitor. Commands end with ; or \g. ← 確認(rèn)用密碼能夠成功登錄
Your MySQL connection id is 6 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> exit ← 退出MySQL服務(wù)器
Bye
刪除匿名用戶
在MySQL剛剛被安裝后,存在用戶名、密碼為空的用戶。這使得數(shù)據(jù)庫服務(wù)器有無需密碼被登錄的可能性,為消除隱患,將匿名用戶刪除。
[root@sample ~]# mysql -u root -p ← 通過密碼用root登錄
Enter password: ← 在這里輸入密碼
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select user,host from mysql.user; ← 查看用戶信息
+------+----------------------------+
| user | host |
+------+----------------------------+
| | localhost |
| | 127.0.0.1 |
| root | localhost |
| | sample.centospub.com |
| root | sample.centospub.com |
+------+----------------------------+
4 rows in set (0.02 sec)
mysql> delete from mysql.user where user=''; ← 刪除匿名用戶
Query OK, 2 rows affected (0.17 sec)
mysql> select user,host from mysql.user; ← 查看用戶信息
+------+----------------------------+
| user | host |
+------+----------------------------+
| root | localhost |
| root | sample.centospub.com |
+------+----------------------------+
2 rows in set (0.00 sec)
mysql> exit ← 退出MySQL服務(wù)器
刪除測試用數(shù)據(jù)庫
在MySQL被安裝后,存在名為test的空數(shù)據(jù)庫,將它刪除。這里要注意的是,系統(tǒng)默認(rèn)的還有一個名為mysql的數(shù)據(jù)庫,它用于系統(tǒng)管理,所以請不要刪除。
[root@sample ~]# mysql -u root -p ← 通過密碼用root登錄
Enter password: ← 在這里輸入密碼
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases; ← 查看系統(tǒng)已存在的數(shù)據(jù)庫
+-------------+
| Database |
+-------------+
| mysql |
| test |
+------------+
2 rows in set (0.02 sec)
mysql> drop database test; ← 刪除名為test的空數(shù)據(jù)庫
Query OK, 0 rows affected (0.07 sec)
mysql> show databases; ← 查看系統(tǒng)已存在的數(shù)據(jù)庫
+-------------+
| Database |
+-------------+
| mysql | ← 確認(rèn)名為test的數(shù)據(jù)庫被刪除,已不存在
+-------------+
1 row in set (0.00 sec)
mysql> exit ← 退出MySQL服務(wù)器
4、測試MySQL
下面對MySQL進(jìn)行測試。包括建立新用戶,以及用對關(guān)系性數(shù)據(jù)庫進(jìn)行數(shù)據(jù)庫操作的指令來試著建立數(shù)據(jù)庫及數(shù)據(jù)表,這里,新建用戶以centospub為例。
[root@sample ~]# mysql -u root -p ← 通過密碼用root登錄
Enter password: ← 在這里輸入密碼
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant all privileges on test.* to centospub@localhost identified by 'newpwd’; ← 建立對test數(shù)據(jù)庫有完全操作權(quán)限的名為centospub的用戶
Query OK, 0 rows affected (0.03 sec)
mysql> select user from mysql.user where user='centospub'; ← 確認(rèn)centospub用戶的存在與否
+---------+
| user |
+---------+
| centospub | ← 確認(rèn)centospub已經(jīng)被建立
+---------+
1 row in set (0.01 sec)
mysql> exit ← 退出MySQL服務(wù)器
[root@sample ~]# mysql -u centospub -p ← 用新建立的centospub用戶登錄MySQL服務(wù)器
Enter password: ← 在這里輸入密碼
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database test; ← 建立名為test的數(shù)據(jù)庫
Query OK, 1 row affected (0.00 sec)
mysql> show databases; ← 查看系統(tǒng)已存在的數(shù)據(jù)庫
+-------------+
| Database |
+-------------+
| test |
+-------------+
1 row in set (0.00 sec)
mysql> use test; ← 連接到數(shù)據(jù)庫
Database changed
mysql> create table test(num int, name varchar(50)); ← 在數(shù)據(jù)庫中建立表
Query OK, 0 rows affected (0.03 sec)
mysql> show tables; ← 查看數(shù)據(jù)庫中已存在的表
+-------------------+
| Tables_in_test |
+-------------------+
| test |
+-------------------+
1 row in set (0.01 sec)
mysql> insert into test values(1,'Hello World!'); ← 插入一個值到表中
Query OK, 1 row affected (0.02 sec)
mysql> select * from test; ← 查看數(shù)據(jù)庫中的表的信息
+------+-------------------+
| num | name |
+------+-------------------+
| 1 | Hello World! |
+------+-------------------+
1 row in set (0.00 sec)
mysql> update test set name='Hello Everyone!'; ← 更新表的信息,賦予新的值
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from test; ← 查看數(shù)據(jù)庫中的表的信息
+------+----------------------+
| num | name |
+------+----------------------+
| 1 | Hello Everyone! | ← 確認(rèn)被更新到新的值
+------+----------------------+
1 row in set (0.01 sec)
mysql> delete from test where num=1; ← 刪除表內(nèi)的值
Query OK, 1 row affected (0.00 sec)
mysql> select * from test; ← 確認(rèn)刪除結(jié)果
Empty set (0.01 sec)
mysql> drop table test; ← 刪除表
Query OK, 0 rows affected (0.01 sec)
mysql> show tables; ← 查看表信息
Empty set (0.00 sec) ← 確認(rèn)表已被刪除
mysql> drop database test; ← 刪除名為test的數(shù)據(jù)庫
Query OK, 0 rows affected (0.01 sec)
mysql> show databases; ← 查看已存在的數(shù)據(jù)庫
Empty set (0.01 sec) ← 確認(rèn)test數(shù)據(jù)庫已被刪除(這里非root用戶的關(guān)系,看不到名為mysql的數(shù)據(jù)庫)
mysql> exit ← 退出MySQL服務(wù)器
Bye
然后,刪除測試用過的遺留用戶。
[root@sample ~]# mysql -u root -p ← 通過密碼用root登錄
Enter password: ← 在這里輸入密碼
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 4.1.20
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> revoke all privileges on *.* from centospub@localhost; ← 取消centospub用戶對數(shù)據(jù)庫的操作權(quán)限
Query OK, 0 rows affected (0.00 sec)
mysql> delete from mysql.user where user='centospub' and host='localhost'; ← 刪除centospub用戶
Query OK, 1 row affected (0.01 sec)
mysql> select user from mysql.user where user='centospub'; ← 查找用戶centospub,確認(rèn)已刪除與否
Empty set (0.01 sec) ← 確認(rèn)centospub用戶已不存在
mysql> flush privileges; ← 刷新,使以上操作生效
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
5、最后,重新啟動一次HTTP服務(wù),讓php-mysql反映到HTTP服務(wù)中。
[root@sample ~]# /etc/rc.d/init.d/httpd restart ← 重新啟動HTTP服務(wù)
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
更多CentOS相關(guān)信息見CentOS 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=14
phpMyAdmin提示“Access denied for user 'root'@'localhost' (using password: NO)”的解決辦法
關(guān)于MySQL中文亂碼的完美解決方案
相關(guān)資訊
CentOS安裝MySQL CentOS配置MySQL
CentOS 7.0下yum安裝MySQL及使用遇 (今 07:41)
CentOS 6.9安裝MySQL 5.1.73 (07月06日)
CentOS 6.7 下RPM方式安裝MySQL 5. (06月16日)
CentOS 7 安裝 MySQL 小記 (10月11日)
CentOS6.4 安裝MySQL 配置遠(yuǎn)程訪問 (06月21日)
阿里云 CentOS 7.3下rpm安裝MySQL (06月06日)
本文評論
查看全部評論 (0)
表情:
姓名:
匿名
字?jǐn)?shù)
同意評論聲明
評論聲明
尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)
承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任
本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容
本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評論
參與本評論即表明您已經(jīng)閱讀并接受上述條款
最新資訊
CentOS 7.0下yum安裝MySQL及使用遇到問題
配置MySQL服務(wù)器端的字符集
使用Eclipse遠(yuǎn)程Debug測試環(huán)境
預(yù)覽版微軟 Edge 瀏覽器已登陸 Android
Python 解析配置模塊之ConfigParser詳解
CentOS 7下編譯安裝Nginx+MySQL+PHP
CentOS 7下Nagios的安裝及配置
Linux安裝Python 3.5.2
CentOS 7系統(tǒng)優(yōu)化腳本
利用蘋果設(shè)備的 Wi-Fi 堆棧實(shí)現(xiàn)內(nèi)核的遠(yuǎn)程
背景:
閱讀新聞
關(guān)于MySQL中文亂碼的完美解決方案
[日期:2014-03-03]
來源:Linux社區(qū)
作者:u013616976
[字體:大 中 小]
當(dāng)用客戶端或用其他方式連接數(shù)據(jù)鍵入中文數(shù)據(jù)后,在client中的顯示為亂碼,當(dāng)然這是字符集設(shè)置出現(xiàn)了問題。我先后嘗試了很多辦法,但依然還是無法在client中顯示中文,我嘗試在my.ini中修改一下數(shù)據(jù)
在[client]
中加入。
# Here follows entries for some specificprograms
default-character-set=utf8
正
[mysqld]
中加入
character-set-server=utf8
然后我就把所有的都設(shè)成了utf8,用可視化工具打開數(shù)據(jù)庫文件,發(fā)現(xiàn)里面的數(shù)據(jù)確實(shí)變成了中文,但是客戶端的界面上依然是亂碼,不過這次好像是中文亂碼,而且有些中文還是能顯示的。
看到這里我仿佛有看到了希望,我知道我肯定還有一點(diǎn)沒有設(shè)置好,當(dāng)然肯定是客戶端的字符集設(shè)置錯誤了,突然想起客戶端的默認(rèn)顯示方式為gbk,然后我在
My.ini中修改一下數(shù)據(jù)
# Here follows entries for some specificprograms
default-character-set=gbk
將客戶端的顯示方式改為gbk。
在客戶端鍵入。
SETcharacter_set_database=utf8;
SETcharacter_set_server=utf8;
SETcharacter_set_client=gbk;
SETcharacter_set_connection=gbk;
即可正常顯示了。
CentOS下MySQL安裝配置過程詳解
Ubuntu下安裝MySQL Workbench
相關(guān)資訊
MySQL亂碼 mysql中文亂碼
MySQL數(shù)據(jù)庫中文亂碼問題解決 (12/02/2015 21:12:51)
MySQL 使用set names 解決亂碼問題 (03/21/2015 13:08:36)
MySQL客戶端輸出窗口顯示中文亂碼 (02/21/2015 09:54:30)
解決MySQL中文亂碼的問題 (05/23/2015 09:10:50)
MySQL亂碼的幾種原因 (03/05/2015 09:06:09)
Java寫入MySQL中文亂碼解決方法 (02/17/2015 09:23:17)
本文評論
查看全部評論 (0)
表情:
姓名:
匿名
字?jǐn)?shù)
同意評論聲明
評論聲明
尊重網(wǎng)上道德,遵守中華人民共和國的各項(xiàng)有關(guān)法律法規(guī)
承擔(dān)一切因您的行為而直接或間接導(dǎo)致的民事或刑事法律責(zé)任
本站管理人員有權(quán)保留或刪除其管轄留言中的任意內(nèi)容
本站有權(quán)在網(wǎng)站內(nèi)轉(zhuǎn)載或引用您的評論
參與本評論即表明您已經(jīng)閱讀并接受上述條款
最新資訊
Oracle官方并行邏輯備份工具mysqlpump
MySQL 5.7 mysqlpump 備份工具說明
MySQL5.7.11 mysqlpump 多線程邏輯備份工具
MySQL 5.6 XtraBackup 全量和增量的備份和
基于XtraBackup 2.3.5 的 MySQL全量備份與
Chrome OS 現(xiàn)可支持簡易密碼解鎖
NSA的代碼遭到教授的嘲笑
Fedora 25將默認(rèn)使用Wayland
Nagios 監(jiān)控 SNMP 溫度計
JavaScript函數(shù)定義與函數(shù)作用域詳解