Hello World from OSS Silicon Valley


HowToUse/MySQL/5.1

_ Prerequisite

_ Install&Setup

Step.1
Install mysql server

$ yum install mysql-server mysql-devel

Step.2
Edit mysql configration file.

$ vi /etc/my.cnf

[mysqld]
...
character-set-server=utf8

[mysql]
default-character-set=utf8
Step.3
If you wish to connect database from remote host, you need to execute the following commands.
$ mysql -u root
> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'password' WITH GRANT OPTION;

_ HowToUse

_ Start Process

Step.1
Start service

$ sudo /etc/rc.d/init.d/mysqld start

Step.2
Config chkconfig so that mysqld is launched by default.

$ sudo chkconfig mysqld on

Step.3
Stop service

$ sudo /etc/rc.d/init.d/mysqld stop

_ Create Database and User

Step.1
Login mysql with root.
$ mysql -u root -p
Step.2
Create database.
> create database <dataase name>;
> grant all privileges on <database name>.* to '<user name>' identified by '<password>';

_ Author

S.Yatsuzuka

Last-modified: 2017-06-22 (Thu) 09:45:31 (2493d)