27 使用MySQLadmin 關閉數據庫
創新互聯公司專業為企業提供香河網站建設、香河做網站、香河網站設計、香河網站制作等企業網站建設、網頁設計與制作、香河企業網站模板建站服務,十余年香河做網站經驗,不只是建網站,更提供有價值的思路和整體網絡服務。
mysqladmin -uroot -poldboy123 shutdown
ps -ef |grep mysql
28 mysql忘記密碼重新修改密碼過程:
mysql> mysqld_safe --skip-grant-tables --user=mysql --defaults-file=/data/3306/my.cnf >/dev/null &
-> mysqld_safe --skip-grant-tables --user=mysql >/dev/null &
-> update mysql.user set password=password("oldboy111") where user='root' and host='localhost';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqld_safe --skip-grant-tables --user=mysql --defaults-file=/data/3306/my.cnf >' at line 1
mysql> update mysql.user set password=password("oldboy111") where user='root' and host='localhost';
Query OK, 1 row affected (0.35 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> Terminated
在此 ,重新開啟一個窗口殺掉mysql 注意!千萬不要用kill-9 粗暴的殺死mysql,這樣會導致數據庫丟數據后果將非常嚴重
ill mysql
[root@root ~]# pkill mysql
[root@root ~]# pkill mysql
[root@root ~]# pkill mysql
[root@root ~]# pkill mysql
[root@root ~]# pkill mysql
[root@root ~]# pkill mysql
[root@root ~]# pkill mysql
[root@root ~]# /etc/init.d/mysqld start
Starting MySQL.... SUCCESS!
[root@root ~]# ps -ef | grep mysql
root 10974 1 0 18:39 pts/2 00:00:00 /bin/sh /application/mysql/bin/mysqld_safe --datadir=/application/mysql/data --pid-file=/application/mysql/data/root.pid
mysql 11148 10974 3 18:39 pts/2 00:00:00 /application/mysql/bin/mysqld --basedir=/application/mysql --datadir=/application/mysql/data --plugin-dir=/application/mysql/lib/plugin --user=mysql --log-error=/application/mysql/data/root.err --pid-file=/application/mysql/data/root.pid
root 11181 10136 0 18:39 pts/2 00:00:00 grep mysql
[root@root ~]# mysql -uroot -poldboy111
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.34-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> \q
Bye
[root@root ~]# mysql -uroot -poldboy111
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.34-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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>
當前名稱:mysql數據庫基礎命令結尾
網頁URL:http://m.newbst.com/article44/pogsee.html
成都網站建設公司_創新互聯,為您提供響應式網站、網站維護、域名注冊、外貿建站、品牌網站設計、電子商務
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯