• Home
  • Idea Book

MySQL, Wordpress and the University of Oregon Computing

November 21st, 2007

so as far as I can tell I am the first person at the University of Oregon to successfully install, setup, and run mysql and wordpress on their UOregon account. So that being said this post is intended to outline step by step the process so most people can do it themselves. Please leave comments on this post to let me know if it was helpful, useful, or didn’t work for you.

So Here we go…

Step 1 - Installing mysql:
In a unix command prompt ssh into your account. Go to the Computing Center’s website if you need more instructions on this.

OK now your in. If you do not have a public_html directory create one now. This is where everything that the public will see will be (basically your whole web page).

mkdir public_html

OK, no we need to manually create a .my.cnf file, this is the business file for configuring mysql. So above public_html type pico .my.cnf. now you will see a text editor. In this file you will add the following:

[mysqld]datadir=/home#/account_name/mysql/
 
socket=/home#/account_name/mysql/mysql.sock
 
port=xxxx
 
user=account_name[mysql]
 
socket=/home#/account_name/mysql/mysql.sock
 
port=xxxx
 
user=account_name
 
[mysql.server]
 
user=xxxx
 
basedir=/home#/account_name/mysql/
 
[client]
 
host=127.0.0.1
 
socket=/home#/account_name/mysql/mysql.sock
 
port=xxxx
 
user=account_name
 
[safe_mysqld]
 
pid-file=/home#/account_name/mysql/mysql.pid
 
err-log=/home#/account_name/mysql/safe.log

Where you see home# enter your home. If you do not know what this is type pwd in your command prompt and it will tell you, for example I am home11, you might be home8 and so on.

Where you see account_name enter your account name. For example jsmith (it is your uoregon account name).

And where you see XXXX enter your port. This is a number of your choice above 5000. For example 5348 or 5729. Just choose anything in the 5000’s.

Your done with this file. Hit control + X to save it and lets move on.

Now it’s time to install mysql.
type

mysql_install_db

(make sure that you are still above public_html)

Now start mysql by typing

mysqld_safe &

OK we are doing great so far.
Now we are going to set the credentials for the mysql so other people cannot connect to the database. So type

/usr/bin/mysqladmin -u root -h shell --port=xxxx password 'new-password'

Where you see xxxx put your port that you specified before and where you see new-password enter the password you want to use to protect it.

Thats it. Now to access your database type:

mysql -u root -h shell --port=xxxx -p

Replacing xxxx with the port you specified before. You will then be prompted for your password. Enter it (you will not see anything appear on screen as you type, that is how it works, just type your password and hit enter.

If all you wanted is mysql, then your done, if you are installing Wordpress then keep reading.

Step 2 - Creating database for wordpress:
First type

create database database_name;

replace database_name with a name of your choice. I prefer wordpress for this.
Next type

GRANT ALL PRIVILEGES ON database_name.* TO "root"@"128.223.142.%" IDENTIFIED BY "password";

replace database_name with the name you specified above and replace password with a password of your choice.

type

FLUSH PRIVILEGES;

And lastly type

EXIT;

Step 3 - configure, setup and install Wordpress
Go to wordpress.org and download wordpress. Using SFTP upload the whole directory to your public_html directory.

Once that is done using pico just like before edit wp-config-sample.php. (These instructions are in the redeme file that came with wordpress.
this file should now have this in it:

// ** MySQL settings ** //define('DB_NAME', 'wordpress');     // The name of the database
 
define('DB_USER', 'username');     // Your MySQL username
 
define('DB_PASSWORD', 'password'); // ...and password
 
define('DB_HOST', '128.223.142.32:xxxx');     // 99% chance you won't need to change this value

replace xxxx with the port you specified in the mysql setup.
Thats it!

Now we need to install Wordpress. Go to the wp-admin directory and type

 chmod 755 install.php

then

pico install.php

add to the first line of this file

#!/usr/local/bin/php

Now you can go to your browser and point it at http://www.uoregon.edu/~your_user_name/wordpress/wp-admin/install.php and follow the instructions.

LAST STEP
This part is the biggest pain. Every time you try and go to a wordpress page and you get “500 internal server error” you need to see what file it is by looking at the browser location bar and then to that file you need to add:

#!/usr/local/bin/php

to the first line and change the permissions to 755 (chmod 755 file_name)

you might be tempted to just go and do this to every file but if you do then you will break it. When one file is included in another the first does not need it, and if it as it then it will be displayed by the browser, and break your page.

Good luck! I hope this helps. I will make edits as my comment suggest. Happy Blogging!

del.icio.us Slashdot Digg Facebook Technorati Google StumbleUpon Bookmark.it Diigo Squidoo

Posted in MySQL, Web Development, Wordpress

One Response to “MySQL, Wordpress and the University of Oregon Computing”

  1. 1 david
    March 19th, 2008 at 2:31 pm

    Thanks for the info. Just got Movable Type up and running with your help.
    Note: the text wrapping in your posted .my.cnf file is off a bit - some of the [mysql] (i.e. section header) lines need to have a newline added
    Note2: suggest adding a “grant” line for a user other than root (ie. same user as in the .my.cnf file)
    Note3: when configuring Movable Type, one has to click the “Advanced Options” link to enter port and socket info. All the php seems to work out of the box.






  • Just another Blog and narcissistic self esteem builder. If you think I have anything to say take a second and let me know - Post a comment - and you too can shamelessly promote yourself just as I do here. Have Fun!
  • Archives

    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • July 2007
  • Categories

    • Advertising
    • APIs
    • Cool Shit
    • CSS
    • Cyber Culture
    • Digital Marketing Conference
    • Idea Book
    • Javascript
    • Live
    • MySQL
    • Rant
    • Tools
    • Uncategorized
    • Web Development
    • Wordpress
  • Blogroll

    • 1 + 1 = 11
    • A List Apart
    • A Moment of Wonderful
    • Dave Shea
    • Deb Morrison
    • Logic + Emotion
    • Love is a Verb
    • Mashable
    • Micro Persuasion
    • Photomatt
    • Professor Christy’s Blog
    • Step into my World…
    • Straight Up With BK
  • Tags

    AJAX API Book Class Cool CSS Facebook FedEx Flash geocoding Google Google Maps ID Idea Book Images Innovation iPhone Javascript Jonathan Harris JSON Life MySQL News OpenSource Overview PackMapr PEAR HTTP_Request PHP Pingdom Politics Programming RSS School Starbucks Stats Tools Tutorial University of Oregon UPS USPS Web Trends Weiden + Kennedy What if Wordpress youTube

Powered by Wordpress | Design by Zach Blank
XHTML Strict | RSS Entries