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

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

WBOY
WBOYOriginal
2016-06-07 16:54:001003browse

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

Statement:
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