Bugfree How to enter MySQL when installing under Linux with XAMPP

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.