mysql数据库基础命令结尾
admin
2023-05-23 19:43:06
0

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> 


相关内容

热门资讯

铠侠与闪迪发布第十代332层Q... IT之家 8 月 4 日消息,铠侠株式会社今天宣布与闪迪公司共同推出下一代四层单元(QLC)3D 闪...
官方通报卫生巾疑现虫卵:对涉事... 8月4日晚,广西桂林市七星区市场监督管理局发布情况通报:4日,网络上关于“购买的卫生巾疑现虫卵”的信...
奖励一颗小行星命名!中国科学家... 中国科学家又有喜讯了。 综合中国气象报社、科技日报消息,当地时间8月3日,在意大利佛罗伦萨举办的第4...
全球最大通信卫星刚上天,休斯为... 卫星互联网商业模式观察 全球最大通信卫星刚上天, 休斯为什么还是被星链逼到破产? 作者 | 老谭 ...
中国版「生物DeepSeek」... 新智元报道 DeepSeek-V4-Flash正式版刚炸翻全球通用大模型圈,中国生命科学版Deep...
汽车回血,AI烧钱,特斯拉迎来... 文|高恒说 特斯拉开始把造车产线让给机器人。 2026年第二季度,特斯拉拆除了弗里蒙特工厂原有的M...
鸿蒙智行承认投诉“竹知了”视频... 针对“竹知了”玩具相关舆情,鸿蒙智行于8月4日晚发布企业声明,介绍了投诉“竹知了”视频相关情况,也表...
抢劫杀人犯死刑改死缓被害人家属... 澎湃新闻记者 熊强云南宣威市乐丰乡1999年“山村小卖部抢劫杀人案”被害人家属申诉迎来新进展:家属徐...
乘客投诉绕路遭出租车司机持铁棍... 8月4日晚,太原市公安局小店分局官方微博通报:7月20日凌晨2时许,我局接到群众报警,小店区体育路许...
中国登山者在巴基斯坦雪崩中遇难... 7月30日,一支10人国际登山队在攀登布洛阿特峰(Broad Peak)时遭遇雪崩失踪。据巴基斯坦高...