Category Archives: MySQL
Tweaks for linux/freebsd apache and mysql – control the load with these tweaks
#Apache httpd.conf tweak: prefork.c module #Add this to httpd.conf ===================== <IfModule prefork.c> StartServers 15 MinSpareServers 10 MaxSpareServers 40 ServerLimit 256Max Clients 256 MaxRequestsPerChild 1000 </IfModule> ===================== #mysql tweak: #add this to my.cnf ===================== key_buffer = 48 Mmax_allowed_packet = 8M table_cache = 128 sort_buffer_size = 48M net_buffer_length = 8M thread_cache_size = 4 query_cache_type = 1 [...]
Show Grants for a MySQL User
To show the granted permissions for a MySQL username, first you will need to know the username that you need to check on. In this article, the username will be test_db. So, to show the information for the user, you will first drop into the mysql shell. root@server [/]#mysql Welcome to the MySQL monitor. Commands [...]
Check the storage engines for MySQL
If you need to find out the available storage engines for MySQL, such as InnoDB, you can run the following command. mysql -Bse 'show engines' That will output the engines and their availability, and will look something like this. root@server [~]# mysql -Bse ‘show engines’ MyISAM DEFAULT Default engine as of MySQL 3.23 with great [...]
Change WordPress password from the command line
If you forget the login to the WordPress dashboard and the “forgot your password” link isn’t working for you, it is possible to change it from the command line. First, you will want to find the database that WordPress is using, so go to the folder that holds it, and get that from the wp-config.php [...]
Delete and recreate a MySQL database
You can delete a mysql database by going into the mysql command prompt and using the drop database command. Therefore, if you have a database named data_base that you would like do delete, you can do the following: #mysql mysql>drop database data_base; Then, to recreate that database, use the create database command mysql>create database data_base; [...]
Restore a MySQL database from a .sql file
You are able to use the command line to restore a database using the mysql command. To restore a file named backup.sql to the database data_base, first make sure that the database is empty, then you can run mysql -o data_base < backup.sql It is good to use mysql -o when restoring the database, which [...]
Create a backup of a MySQL database
To make a backup of a mysql database, you are able to use the mysqldump command. If you are backing up a database named data_base and want the backup file to be named backup.sql, you can use this command mysqldump data_base > backup.sql This will create the file backup.sql, which contains the information from the [...]
