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> 


相关内容

热门资讯

山西明长城遭煤矿损毁,省级专案... 近日,山西忻州宁武县境内明长城被露天煤矿长期破坏一事引发广泛关注。5月18日,指尖新闻从宁武县文物保...
防盗门的漆掉了一块,该如何修补... 先在那块处理干净,然后喷三和的防锈底漆(也是自喷漆),等待防锈底漆干了以后再喷带颜色的自喷漆!这样效...
床漆掉了怎么办 床漆掉了以后要清理掉漆位置的灰尘,特别是掉漆位置的碎屑,用最细的砂纸进行打磨,打磨完毕后,用强力胶涂...
热水器塑料管掉了怎么办 当热水器塑料管掉了,我们需要立即采取行动来修复它,以防止水浸泡室内地面。下面是处理掉落塑料管的一些步...
国家能源局:2026年4月份全... 【大河财立方消息】5月19日,国家能源局发布4月份全社会用电量等数据。4月份,全社会用电量8205亿...
新疆天业获得实用新型专利授权:... 证券之星消息,根据天眼查APP数据显示新疆天业(600075)新获得一项实用新型专利授权,专利名为“...
市场监管总局:“四新经济”个体... 记者今天(19号)从市场监管总局发布会获悉,个体工商户是民营经济的重要组成部分,是我国数量最多的经营...
台湾还有几个十年? 明天,赖清德上台就要满两周年了。图源:台媒每年这个时候,都是民进党涂脂抹粉的重要时刻。今年的“520...
伊朗称在东南部摧毁4个极端组织... 当地时间19日,伊朗情报部发表声明称,伊朗东南部锡斯坦-俾路支斯坦省情报部门摧毁4个极端组织武装小组...
2026年全民数字素养与技能提... 以“文明网络空间 昂扬奋进力量”为主题的2026年中国网络文明大会,5月19日在广西壮族自治区南宁市...