Home > Database > Mysql Tutorial > Ubuntu中用MySQL-Client连接XAMPP中的MySQL-Server

Ubuntu中用MySQL-Client连接XAMPP中的MySQL-Server

WBOY
Release: 2016-06-07 16:54:00
Original
1071 people have browsed it

XAMPP是绿色的,而且不会开机自动启动。即使在Linux中,我还是喜欢绿色的软件。首先在Ubuntu安装MySQL-Client:sudo apt-get ins

XAMPP是绿色的,而且不会开机自动启动。即使在Linux中,,我还是喜欢绿色的软件。

首先在Ubuntu安装MySQL-Client:

sudo apt-get install mysql-client

启动XAMPP中的mysql:

sudo /opt/lampp/lampp startmysql

此时如果直接连接的话会报错:

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

解决方法:

sudo mkdir /var/run/mysqld

sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock

再次连接:

mysql -u root -p

连接上了,问题解决。

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template