How to clear or purge MySQL Bin log Files

Binary log MySQL Official website defines the binary log as following: The binary log contains “events” that describe database changes such as table creation operations or changes to table data. It also contains events for statements that potentially could have made changes (for example, a DELETE which matched no rows). The binary log also contains […]

Read More

Recover Corrupted Table [MySql]

Why does the database crash!? What can we do if it does? A database corruption can be due to many scenarios, like when a query does not find a table where its supposed to or when the query comes back with incorrect data. They  can get corrupted due to a various of reasons,  we can […]

Read More mode

Ever came across an error like these:

The solution is very simple. In php.ini file, set

If sql.safe_mode is enabled, mysql_connect() and mysql_pconnect() ignore any arguments passed to them. Instead, PHP attempts to connect using the following details: host: local host user: the user PHP runs as password: an empty string (“”) […]

Read More

Reset root password for MySQL

You can view the MySQL root password in the file /root/.my.cnf.

Want to reset the root password for MySQL? Follow the below steps. 1. Stop mysql 2. Create a text file(for eg: /home/mysql-init) and place the following statements in it. Replace the password with the password that you want to use.

3. Execute […]

Read More

Common errors

Error #1

Solution: If you’re getting the above error while starting mysql, check the mysql error log by using the following command:

Here you can see the reason. Issue maybe due to the presence of incorrect variables existing in ‘/etc/my.cnf’. Error #2

Solution: Make sure that /var/lib/mysql/mysql.sock is existing. Also, confirm the […]

Read More