Run your XAMPP without mysql problem

Couldn't start MySQL! while starting XAMPP.

Hello handsome/beautiful, I am back. 

Most common and most popular problem it is. Everyone wants to solve this problem and they search online always and try hard to find it. But it's take so much time to solve so I thought I should make an article about this problem. Here is the way you can solve this problem. 

There are many kinds of ways you can solve this problem. I am showing you all kinds of ways.
This is first way you can solve your mysql problem

1. First of all we need to take right permission of file. Through this command, The owner has all the permissions to read, write and execute. Everyone else can only read and execute, but cannot make changes to the file.

sudo chmod 755 /opt/lampp/etc/my.cnf

2. Here is the second command you need to execute :). Through this command, Everyone can read write and execute. In a web server, it is not advisable to set this permission for your files and folders as it allows anyone to add malicious code to your server. And ' -R ' means I am choosing full directory not a single file.

sudo chmod -R 777 /opt/lampp/var/mysql

3. Now execute last command and this will take you to the moon ;p. Here ' -h ' means This is useful only on systems that can change the ownership of a symlink. It's affect symbolic links instead of any referenced file. And ' -R ' means choosing full directory or in other words operate on files and directories recursively. Lets execute this moon command :)

sudo chown -hR root:root /opt/lampp
or
sudo chown -hR [username:username] /opt/lampp

4. Now restart your server

sudo /opt/lampp/lampp restart


Here is the second way you can solve your mysql problem

In this way we are going to fully remove XAMPP server from your computer. 

1. We need to stop server first

sudo /opt/lampp/lampp stop

2. Then uninstall/remove it using this command

sudo rm -rf /opt/lampp/

3. Reinstall it.


We have an another way to solve it let's see
This is last and most popular way to solve this problem. Sometimes our mysql automatically start on startup. If you want to check the status of mysql through sudo /etc/init.d/mysql status . You will see it's status dead. But some PC's don't support linux correctly. So, it can be a wrong answer. After installing XAMPP on linux, all the things works fine. But after rebooting the system you will see an error. This is way you can solve your error message :). Please follow this commands

sudo /etc/init.d/mysql start or sudo service mysql start

after starting mysql server you need to stop it, through this command

sudo /etc/init.d/mysql stop or sudo service mysql stop

Then start you lamp server,

sudo /opt/lampp/lampp start



Is it solved. If not please tell me. I will try to solve your problem :). By the way, I don't have enough time to describe every part of this command but if you want to know then knock me.
HAVE A GREAT LIFE 

Comments

Popular posts from this blog

Automatic Date and Time Enable Kali Linux

How to start hotspot in kali linux

How to detect proxy IP or real IP