‘壹’ linux mysql停止服务命令
1、使用 service 停止:service mysqld stop2、使用 mysqld 脚本停止:/etc/inint.d/mysqld stop
3、 mysqladmin shutdown
‘贰’ 在linux下强行关闭mysql数据库数据会丢失吗
一般来说不会,你用service mysqld stop来停止数据库。
如果担心数据丢失可以尝试清缓冲
‘叁’ 请问linux下MySQL的停止命令
引用楼主
taotaox
的回复:小弟装的是Ubuntu的server,sudo
/etc/init.d/mysql
stop
此命令行不通。mysql
stop
显示什么被拒绝,好像是密码不对吧没用过,帮顶。
‘肆’ linux怎么启动mysql服务
1、首先,我们需要修改mysql的配置文件,一般文件存放在/etc下面,文件名为my.cnf。
‘伍’ Linux下如何彻底删除MySQL
控制面板——》所有控制面板项——》程序和功能,卸载mysql
server!
然后删除mysql文件夹下的my.ini文件及所有文件
运行“regedit”文件,打开注册表删除HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL文件夹
删除HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL文件夹。HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL的文件夹。如果没有可以不用删除了。
删除C盘下的“C:\ProgramData\MySQL
”所以文件,如果删除不了则粉碎掉即可,该programData文件是隐藏的默认,设置显示后即可见,或者直接复制上边的地址到地址栏回车即可进入!删除后重启电脑,重装MYsql数据库应该就成功了。
‘陆’ linux命令怎么退出mysql界面
结论:键入 exit 退出 MySQL 命令行。
经常可能MySQL命令行内写的乱七八糟,也解析错误,类似这样:
clear
有时候甚至命令行快捷键 Ctrl + C , Ctrl + D 都没什么作用的时候,c 是最实用的。
以上。
‘柒’ 怎么删除linux中mysql数据库
在linux下开发,mysql数据库是经常用到的,对于初学者来说,在linux怎么安装卸载mysql数据库,也许可能比较痛苦,这里简单介绍下,怎么卸载msql数据库。
a)查看系统中是否以rpm包安装的mysql
[root@linux ~]# rpm -qa | grep -i mysql MySQL-server-5.1.49-1.glibc23 MySQL-client-5.1.49-1.glibc23
卸载MySQL-server-5.1.49-1.glibc23和MySQL-client-5.1.49-1.glibc23
[root@linux ~]# rpm -e MySQL-client-5.1.49-1.glibc23 [root@linux ~]# rpm -e MySQL-server-5.1.49-1.glibc23
b)查看有没有mysql服务
[root@linux ~]# chkconfig --list | grep -i mysql mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
删除mysql服务
[root@linux ~]# chkconfig --del mysql
c)删除分散mysql文件夹
[root@linux ~]# whereis mysql
mysql: /usr/lib/mysql /usr/share/mysql
分别删除
[root@linux lib]# rm -rf /usr/lib/mysql/
[root@linux lib]# rm -rf /usr/share/mysql
通过以上几步,mysql应该已经完全卸载干净了
‘捌’ linux系统mysql数据库密码忘了怎么办
方法一:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> update user set password=password(newpassword) where user=root;
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
enter password: <输入新设的密码newpassword>
mysql>
方法二:
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql -udebian-sys-maint -p
enter password: <输入[client]节的密码>
mysql> update user set password=password(newpassword) where user=root;
mysql> flush privileges;
mysql> quit
# mysql -uroot -p
enter password: <输入新设的密码newpassword>
mysql>
方法三:
这种方法我没有进行过测试,因为我的root用户默认密码已经被我修改过了,那位有空测试一下,把结果告诉我,谢谢!!
# mysql -uroot -p
enter password: <输入/etc/mysql/debian.cnf文件中[client]节提供的密码>
方法四:
方法如下: 1, 关闭mysql服务 /etc/init.d/mysqld stop 2,使用 –skip-grant-tables选项启动mysql服务,可以修 改/etc/inin.d/mysqld脚本启动位置增加此选项, vi /etc/init.d/mysqld
方法如下:
1, 关闭mysql服务
/etc/init.d/mysqld stop
2,使用 –skip-grant-tables选项启动mysql服务,可以修 改/etc/inin.d/mysqld脚本启动位置增加此选项,
vi /etc/init.d/mysqld
在下面运行启动的语句里增加--skip-grant-tables
/usr/bin/mysqld_safe --skip-grant-tables --datadir="$datadir" --socket="$socketfile"
--log-error="$errlogfile" --pid-file="$mypidfile"
加入--skip-grant-tables的意思是启动mysql服务的时候跳 过权限表认证。启动后,连接到mysql的root不需要口令
3,重新启动mysql服务
/etc/init.d/mysqld start
4. 修改root用户的密码;
mysql> update mysql.user set password=password(123456) where user=root;
mysql> flush privileges;
mysql> quit
5. 重新启动mysql,就可以使用 新密码登录了。
mysql
mysql -u root –p
输入密码:123456
6,关闭mysql服务
/etc/init.d/mysqld stop
7, 重新修改第2步修改的/etc/init.d/mysqld,使其保持原来不变,也就是取消--skip-grant-tables语句
8,重新 启动mysql服务
/etc/init.d/mysqld start