linux下的xampp安裝及mysql終端登入
一。xampp的安裝
1.下載xampp-linux-1.7.3a.gz
2.解壓裡面的lampp目錄到/opt/下
3.開啟終端,並su root
4.進入到lampp目錄:cd /opt/lampp
5.執行檔案/opt/lampp/lampp:./lampp start
6.安裝成功提示為:
------------------------
[email protected]:/home/janchow# cd /opt/lampp
[email protected]:/opt/lampp# ./lampp start
Starting XAMPP for Linux 1.7.3a...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for Linux started.
------------------------
注:有的人安裝可能會不成功,提示:
XAMPP: SELinux is activated. Making XAMPP fit SELinux...
Starting XAMPP for Linux 1.7.1...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Couldn't start MySQL!
XAMPP: Starting ProFTPD...
XAMPP for Linux started.
此時則要執行以下步驟:
1)進行如下操作:
#chown -hR root /opt/lampp
# /opt/lampp/lampp start
# chmod 777 -R /opt/lampp/var
2)#cd /opt/lampp/etc
#chmod 755 my.cnf
3)重啟重進入root執行 ./lampp start
這樣就OK啦!
二.mysql的登入
到此步就已經安裝成功了,但是要想在終端中登入mysql卻還不行,要執行以下
命令:
1.sudo apt-get install mysql-client-core-5.1
2.sudo /opt/lampp/lampp startmysql
3.sudo mkdir /var/run/mysqld
4.sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
5.執行登入命令mysql -u root -p