Phat Site Blog

Tag: mysql

MySQL 5 – Creating a Username and Assigning Permissions

by admin on Feb.15, 2009, under Server Maintenance

Here’s a quick way to get a mysql up and running with all user permissions.
CREATE USER ‘newuser’@'localhost’ IDENTIFIED BY ‘password’;
GRANT ALL ON database.* to ‘newuser’;

Leave a Comment : more...

Turn On Your Lamp – Easy Apache/PHP/MySQL Install on CentOS for Web Developers

by admin on Feb.15, 2009, under Other

vi /etc/yum.repos.d/CentOS-Base.repo
find [centosplus] and locate:
enabled = 0

change to

enabled = 1

yum install php php-mysql mysql-server php-gd postgres ImageMagick ImageMagick-devel

Now you got php, mysql, graphic manipulation, and posgres installed.

Let’s setup your MySQL:
/etc/init.d/mysqld restart – after you run this, you will get a bunch of useful text, read it!
/usr/bin/mysqladmin -u root password ‘CHANGEMETOHARDPASSWORD’
/sbin/chkconfig mysqld –level 2345 on  – lets mysql startup on reboot

Now you have PHP installed with common libraries such as image manipulation and postgres and mysql for database work.

2 Comments :, , more...

Creating a MySQL 5.0 Database for your Web Application

by admin on Jan.25, 2009, under Server Maintenance

> mysql -u root -p
Enter password: <enter your password>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Server version: 5.0.45 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database newdb;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON newdb.* TO newdbuser@localhost IDENTIFIED BY ‘password_for_newdbuser’;

To test if it’s created, run this command:
> mysql -u newdbuser -p
Enter password: <enter your password>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Server version: 5.0.45 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> show databases;
+——————–+
| Database           |
+——————–+
| newdb              |
+——————–+
3 rows in set (0.00 sec)

mysql> use newdb;
Database changed
mysql> exit
Bye

Everything looks good!  Your database is created! Now you’re ready to create your Wordpress blog, just configure the settings with your database name, username, and password. ;-)

1 Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!