mysql数据库基础命令结尾

发布时间:2020-08-03 20:06:23 作者:小辛linux
来源:网络 阅读:516

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> 


推荐阅读:
  1. 文件的结尾和文件开头
  2. php文件后缀名以什么结尾

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mysql 库基础 l数据库

上一篇:Vue快速入门-1-Vue的简单使用

下一篇:转变--------大数据的抉择之路

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》