After Linux installation XAMPP, the Apache server fails to start, and after startup, the solution to problems encountered by connecting to the SQL database

Source: Internet
Author: User

XAMPP installation, when we build the server, what problems will we encounter?
1. MySQL Database can be started, and Apache Web server cannot start?
Should be 80 port is occupied, then how to solve it? We can do this by finding out which 80 is occupied and shutting down the process as follows:

1 grep :2 tcp        0      00.0.  0.0:              0.0.  0.0:*               LISTEN      1716/apache2

Close the service,

1 sudo  2 * Stopping Web server apache2: Waiting. [OK]

successfully closed. Next, you can start Apache Web Server with a port of 80.

2, after successfully opening the Apache Web Server service, I want to debug MySQL, found that MySQL Database startup, but unable to open the connection SQL, and the following error occurred

1 [email protected]:/opt/lampp/var/mysql# mysql-u root-p232002 (HY000): Can'/var/run/mysqld/mysqld.sock'  (2)

At this point, I was wondering how to find out where Mysqld.sock was. Eventually not found, only found Mysql.sock located in

1 ls 2 Aria_log. 00000001      ibdata1      multi-master.  Info  performance_schema  tc.log3Aria_log_control   Challenges  ib_logfile0  mysql              phpmyadmin          test4 bt.err             dvwa        ib_logfile1  mysql.sock         Security

OK, when we find mysql.sock, we right-click the Create link and rename it to mysqld. Sock and then right-cut the file,

and put it in the path showing the error prompt, that is, to/var/run/, if there is no Mysqld folder, you have to create a new, and put Mysqld.sock in.
So now there's the Mysqld.sock file, and here at/var/run/mysqld/mysqld.sock.
Now, we can run

1 [email protected]:/# mysql-u root-p231045 (28000  for ' Root '@'localhost' (using Password:yes)

Found or error, this is because before, can not find Mysqld.sock, thought is the wrong password, modified the/opt/lampp/etc/under the MY.CNF, the password changed back

The default your_name, in effect, is a blank password. The contents are as follows

1 # The following options would be passed to all MySQL clients [client] 2 # password    =your_name3 Port         = 33064 Socket       =/opt/lampp/var /mysql/MySQL. sock

Okay, run it again.

1 [email protected]:/# mysql-u root-p23Welcome to the MySQL monitor. Commands End With; or \g. 4 ID Panax Notoginseng 5 5.5. 5-10.1. 9-MariaDB Source distribution6 ... 7 mysql>

Successfully completed, MySQL connection.


After Linux installation XAMPP, the Apache server fails to start, and after startup, the solution to problems encountered by connecting to the SQL database

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