Many trainees install the bug tracker in a Linux environment with the help of the XAMPP integration environment, but if you want to enter MySQL, use the normal command:
Mysql-uroot-p will prompt the following error:
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
So how do I get to MySQL? Please follow the steps below to try.
Method 1: the error is because the command tool in XAMPP is in the/opt/lampp/bin/directory, so you can run the MySQL command like this:
/opt/lampp/bin/mysql-uroot-p
Method 2: You can also go to the/opt/lampp/bin/directory to execute the mysql command:
cd/opt/lampp/bin/
./mysql-uroot-p
Method 3: The/opt/lampp/bin/can also be soft-linked to the user root directory, which can be performed through ~/:
Ln-s/opt/lampp/bin/~/lbin
~/lbin/mysql-uroot-p (lbin name for himself)
Method 4: You need to switch the path because the command is not added to the environment variable, so you can also add the/opt/lampp/bin/directory directly to the environment variable, so that you can use the MySQL command directly. The steps are as follows:
Open ~/.BASHRC File
On the last line join
# PATH
Export Path=/opt/lampp/bin: $PATH
Save exit Execute command in this file
SOURCE ~/.BASHRC
add: /opt/lampp/lampp can also be soft connected to the ~ directory, you can use the ~/LAMPP start directly to start
Ln-s/opt/lampp/lampp ~/lampp
~/lampp/start
Bugfree software testing tools for Linux practical courses
Http://edu.51cto.com/course/course_id-4855.html
This article from "Hao Yang _ Habitat" blog, please be sure to keep this source http://zdytesting.blog.51cto.com/5811414/1811613
Bugfree How to enter MySQL when installing under Linux with XAMPP