MySQL for WordPress
- To get started, run
mysql -u root -pasroot - Once you're logged in, create your environment:
CREATE DATABASE database_name;CREATE USER "example"@"localhost" IDENTIFIED BY "password";(use Keychain Access to generate a password)GRANT ALL PRIVILEGES ON database_name TO "example"@"localhost";FLUSH PRIVILEGES;EXIT
- After this point, you should be able to let WordPress take care of the rest. If you need to do manual labor, rerun MySQL as a non-root user, for example
examplewithmysql -u example -p
To aid immensely in system performance (I got memory usage down from 47% to 13%), edit the .cnf file at /etc/mysql/my.cnf (might be called something else) with these flags:
[mysqld]
performance_schema = off
key_buffer_size = 16M
tmp_table_size = 1M
innodb_buffer_pool_size = 1M
innodb_log_buffer_size = 1M
max_connections = 25
sort_buffer_size = 512K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
join_buffer_size = 128K
thread_stack = 196K