Configure Wordpress on OS X
Configuring MySQL
Now that you have installed MySQL, let’s configure it so WordPress can access it. Open a new terminal session (found in /Applications/Utilities/Terminal.app) and type the following commands to navigate, make some changes, and start the MySQL daemon:
cd /usr/local/mysql
sudo chown -R mysql data/
sudo echo
sudo ./bin/mysqld_safe &
Next, let’s launch MySQL and use the test database (called test, even) to make sure everything’s running correctly:
/usr/local/mysql/bin/mysql test
If everything’s running correctly, you should see output similar to this:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version 4.0.24-standard
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
Once you’ve verified that MySQL is running correctly, use the command quit to return to the console prompt.
Now that MySQL is running, we’ll change the root password of MySQL so that WordPress (and you) can access it later. Use this command (where yourpasswordhere is replaced by your chosen password):
/usr/local/mysql/bin/mysqladmin -u root password yourpasswordhere
The last thing we’ll have to do in MySQL is to create a table for WordPress to store its data. We’ll call it wordpress to keep things simple. To accomplish this, we’ll enter MySQL, create the table, and allow WordPress to edit it.
/usr/local/mysql/bin/mysql -u root -p
CREATE DATABASE wordpress;
quit
Create the WordPress MySQL Database and User
WordPress doesn’t create its own database so we have to do that ourselves. We’re also going to create a dedicated MySQL user account for WordPress. This isn’t strictly necessary, you can use the root account, but its good security policy for the final web site and not hard to do. I’m using a database name of ‘wordpress’, a MySQL username of ‘wpuser’ and a password for that username of ‘wppass’. Feel free to substitute your own choices.
QUIRK #1: MySQL v4.1 made changes to its password format that WordPress or probably more accurately PHP does not handle but fortunately they included a function old_password() to generate the older format that works.
6. Perform the following commands from a Terminal command line:
$ mysql -u root -p
Enter Password: {ROOTPASS}
> create database wordpress;
> grant all privileges on wordpress.* to wpuser@localhost identified by ‘foo’;
> set password for wpuser@localhost = old_password(’wppass’);
> quit
*N.B. wpuser and wppass will be the username and password for your wordpress setup unless you change them in the step above.
Accessing the sites from your web browser:
Point your web browser at http://localhost/~{USER} (being your ome folder) this will lead the browser to your Sites folder.
WP-CONFIG.PHP
edit the wp-confg-sample.php with the following information - assuming the information above:
define(’DB_NAME’, ‘wordpress’); // The name of the database
define(’DB_USER’, ‘wpuser’); // Your MySQL username
define(’DB_PASSWORD’, ‘wppass’); // …and password
define(’DB_HOST’, ‘Localhost’); // 99% chance you won’t need to change this value ** Note capital L
define(’DB_CHARSET’, ‘utf8′);
define(’DB_COLLATE’, ”);
Visit localhost/~USER/blogdirectory/wp-admin/install.php
All done!
___________
Terminal Stuff
Default directory: cd /usr/local/mysql
./bin/mysql commandshere