Setting up a new UTF8 MySQL Database
01/20/2010
Create a UTF8 database:
> CREATE DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Create a user for the database:
> CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'user_pass';
Grant all privileges to the user:
> GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost' WITH GRANT OPTION;
> FLUSH PRIVILEGES;
You should probably not give him all privileges on all databases, but you can change that as needed.
If for some reason the IDENTIFIED BY clause did not work (you probably uses '%' instead of 'localhost'), then do the following to fix that users password.
# mysql -u root -p
> use mysql;
> UPDATE user SET Password = PASSWORD('new_pass') WHERE User = 'user_name';
Thats it. Enjoy...
Tags
1and1
Apache
Audio
Austin Hill
Automator
Budget Travel
Career
cloud foundry
Community
Consulting
Cyberduck
Debian
Development
Drupal
EC2
European Travel
Eurotrip
ffmpegx
Framework
Git
git-http-backend
github
GiveMeaning
Image
Mac
Macports
Memcached
Mesh Conference
mod_python
Mongrel
Mongrel Cluster
Mouse Gestures
MySQL
NginX
node.js
Package Management
Parallels
Philanthropy
PHP
Preview
Python
Rails
Rapid Development
Relational Scaling
Resize
Rip
RoR
Ruby On Rails
S3
Satchmo
SimpleDB
SQS
Textmate
Tom Williams
Trends
Ubuntu
Web
Web Services
Wordpress
Workflow
Will Stevens
I am a software developer with a primary focus on web applications. I am always trying to find new and better ways to solve business problems with elegant software.

