mysql不是內部或外部命令,解決方法
在Windows server 2003中打開DOS,通過輸入命令“mysql -u root -p”切換到mysql下
C:\>mysql -u root -p
'mysql' 不是內部或外部命令,也不是可運行的程序或批處理文件。
出現這種錯誤的原因是沒有在環境變量PATH中將mysql的路徑添加進去。在WindowsXP平臺下,需要按照下面的方法來將mysql路徑添加到環境變量中:
右鍵點擊“我的電腦”-“屬性”-“高級”-“環境變量”-“系統變量”-雙擊“Path”-將mysql的路徑“C:\Program Files\MySQL\MySQL Server 5.0\bin”添加進去-“確定”
添加完畢之後,再到DOS下進行測試:
C:\>mysql -u root -p
Enter password: **********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
成功!