HostOnNet Blog

Category Archives: MySQL

To disable MySQL strict mode, edit my.cnf file Find something like following. Replace with Now restart MySQL Verify MySQL Strict Mode To verify if you are running MySQL on strict mode or not, run If MySQL is not running under

When taking MySQL backup with mysqldump, i get following error On Ubuntu 16.04, this error is fixed by editing Find Add brlow Here is the modified file Edit 50-server.cnf Find Update value to higher, something like Now restart MySQL Verify

Create a directory in the drive you want to store MySQL datadir. In this example, we create mysql folder in /backup partition. Now we have MySQL data copied, but we don’t have all data as MySQL service is running and

myisamchk is a command line tool to repair MySQL MyISAM database. You need to run it a user root. To repair all MyISAM tables in a database, run Example [root@localhost ~]# myisamchk –recover /var/lib/mysql/w3blogs/wp_blogs – recovering (with sort) MyISAM-table ‘/var/lib/mysql/w3blogs/wp_blogs’

MySQL Slow Query Log i used to find SQL query that are slow. To enable Slow Query Log, add following to /etc/my.cnf file under [mysqld] section. If you don’ have folder /var/log/mysql/, create it Now restart MySQL or

On a VPS, MariaDB refused to start with error [root@ip-10-0-51-171 mariadb]# service mariadb start Redirecting to /bin/systemctl start mariadb.service Job for mariadb.service failed because the control process exited with error code. See “systemctl status mariadb.service” and “journalctl -xe” for details.

mysqlcheck command can be used to check, repair, optimize or analyzes tables in a MySQL database. To check a database for errors, run If you database need user name and password, specify it with -u USER-NAME -p, for example This

On a server, PHP can’t connect to MySQL with following code, it returned error “Could not connect: Permission denied 2002” If i change “localhost” with IP address 127.0.0,1, PHP script is able to connect to MySQL server properly. If i