Forked from jasperf/home-brew-mysql-essential-commands
Created
November 15, 2018 11:15
-
-
Save NerdGr8/84aed0bf8e2396f560e8d1c08c26e282 to your computer and use it in GitHub Desktop.
Homebrew Create a MySQL database and user to be used for a WordPress site from the command line with mysql and restart server when you have a socket error or other error #wordpress #mysql #homebrew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//homebrew mysql start | |
/usr/local/Cellar/mysql/5.6.19/bin/mysql.server restart | |
//or | |
mysql.server start | |
//check for access privileges | |
mysqlaccess localhost user database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client | |
$ mysql -u adminusername -p | |
//Homebrew installed mysql does not require password for root | |
Enter password: | |
Welcome to the MySQL monitor. Commands end with ; or \g. | |
Your MySQL connection id is 5340 to server version: 3.23.54 | |
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. | |
mysql> CREATE DATABASE databasename; | |
Query OK, 1 row affected (0.00 sec) | |
mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname" IDENTIFIED BY "password"; | |
Query OK, 0 rows affected (0.00 sec) | |
mysql> FLUSH PRIVILEGES; | |
Query OK, 0 rows affected (0.01 sec) | |
mysql> EXIT | |
Bye | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment