方法一:
指令:
[[email protected] /]# /etc/init.d/mysql
start|stop|restart|reload|force-reload
[[email protected]
init.d]#
/etc/init.d/mysql
start|stop|restart|reload|force-reload
方法二:
比較常用的MySQL指令:
一、啟動方式
1、使用 service 啟動:[[email protected] /]# service mysqld
start
(5.0版本是mysqld)
[[email protected]
etc]# service mysql
start
(5.5.7版本是mysql)
Shutting down MySQL.....[确定]
Starting MySQL.[确定]
[[email protected] etc]#
2、使用 mysqld 腳本啟動:/etc/inint.d/mysqld start
3、使用 safe_mysqld 啟動:safe_mysqld&
二、停止
1、使用 service 啟動:service mysqld stop
2、使用 mysqld 腳本啟動:/etc/inint.d/mysqld stop
3、mysqladmin shutdown
三、重新開機
1、使用 service 啟動:service mysqld restart (我就用這個指令搞定的,5.0版本指令)
service mysql restart
(5.5.7版本指令)
2、使用 mysqld 腳本啟動:/etc/init.d/mysqld
restart
另外還有比較特殊的安全的重新開機方法(我試了不管用,囧!)
$mysql_dir/bin/mysqladmin -u root -p shutdown
$mysql_dir/bin/safe_mysqld &
另外附上VNCServer無法通路的解決方法:
我就直接PUTTY上SSH登陸,然後敲入指令
vncserver
就這樣就正常了!O(∩_∩)O哈哈~
--------------------------------------------------------------------------------------------------
至些你的MySQL服務的基本配置就到些完成,下面是一些在網絡上找的一些常用的MySQL重新開機指令,附上以友善大家使用
/etc/init.d/mysql
start
啟動MySQL
/etc/init.d/mysql
restart
重新啟動MySQL
/etc/init.d/mysql
shutdown
關閉MySQL的指令
/etc/init.d/mysql
stop
停止MySQL服務
[email protected]:~$ MySQL -uroot
-p
登入MySQL伺服器,在上面有講解
下面還有關一些常用MySQL内部操作提示符
show databases; 顯示所有資料庫清單
use test; 打開庫
show tables; 檢視找開資料庫中所有資料表
describe tableName; 查詢表結構
create table 表名(字段設定表); 建立表
create database 資料庫名; 建立資料庫
drop database 資料庫名; 删除資料庫
drop table tablename 删除表結構
delete from 表名; 删除表資料
select * from 表名; 查詢指定表中所有資料