MySQL Base Configration Instructions

一、Install MySQL Community Service

MySQL Community Edition is the freely downloadable version of the world’s most popular open source database.It is available under the GPL license.
You can use the “apt-get install” command of Ubuntu to install MySQL Database.

$ sudo apt-get install mysql-server 

Notes: When you install MySQL, you need to specify root account and password for MySQL.

$ sudo apt-get install mysql-client

After the MySQL installation is successful, MySQL server should start automatically. You can execute the following command to check MySQL server’s status:

$ sudo netstat -tap | grep mysql

The command is use to check listening port of MySQL, if these is listening port is exist that it is running.

二、MySQL Configration Instructions

1. Check to ensure that mysql server is running. It is not running, execute the following command to start it:

$ sudo /etc/init.d/mysql start 

$ sudo /etc/init.d/mysql stop

$ sudo /etc/init.d/mysql restart 

2. Login to mysql with root account.

$ mysql  -u root –p    // concrete format : mysql -u <UserName> -p [UserPassword]

3. Create  MySQL account:

Method one:

Mysql> insert into mysql.user(Host,User,Password) values("localhost","<UserName>",password("<UserPassword>"));

Mysql> flush privileges;

Method two:

Mysql> CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';

If you specify only the user name part of the account name, a host name part of '%' is used.
The user specification may indicate how the user should authenticate when connecting to the server:
To enable the user to connect with no password (which is insecure), include no IDENTIFIED BY clause:

Mysql>CREATE USER 'jeffrey'@'localhost';

In this case, the account uses the default authentication plugin and clients must provide no password.
To assign a password, use IDENTIFIED BY with the literal plaintext password value:

Mysql>CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass';

The account uses the default authentication plugin and clients must match the given password.

4. Create  a database named “dellwyse” for PocketWeb Server :
Mysql> CREATE DATABASE <DatabaseName> DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;  
Notes: MySQL database name and table name are case sensitive in Linux. In Windows they are case insensitive.

5. Set access control permissions for user dellwyse.
Mysql> GRANT ALL PRIVILEGES ON *.* to '<UserName>'@'%' IDENTIFIED BY '<UserPassword>' WITH GRANT OPTION;

Mysql> GRANT ALL PRIVILEGES ON *.* to '<UserName>'@'localhost' IDENTIFIED BY '<UserPassword>' WITH GRANT OPTION;

// Mysql> GRANT ALL PRIVILEGES ON *.* to '<UserName>'@'< concrete IP Address>' IDENTIFIED BY '<UserPassword>' WITH GRANT OPTION;

Note: User grant information can view in mysql database's user table.

Mysql> flush privileges;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值