Configure the remote server php environment-mysql

Source: Internet
Author: User
Configure the remote server php environment --- mysql1. install mysql # yum-yinstallmysql-server ?? Check whether the command is installed, as shown below: rpm-qa | grep-imysql view installed package version rpm-epackage.rpm Delete package rpm-Va view lost package rpm-qfpackage.rpm view which big package is missing? 2. Configuration

Configure the remote server php environment --- mysql 1. install mysql # yum-y install mysql-server? ? Check whether the command is installed. Run the following command: rpm-qa | grep-I mysql to check the installed package version: rpm-e package. rpm Delete package rpm-Va view the missing package rpm-qf/package. rpm to check which big package is lost? 2. Configuration

Configure the remote server php environment --- mysql

1. Install mysql

# yum -y install mysql-server

? ? Check whether the command is installed as follows:

Rpm-qa | grep-I mysql view the installed package version rpm-e package. rpm Delete package rpm-Va view the missing package rpm-qf/package. run rpm to check which package is missing

?

2. Configure mysql

? ? (1) edit the configuration file

#vim /etc/my.cnf

? ? (2) edit the vi editor. Common commands are as follows:

? ? Esc exits in any mode: next;: prev last q (! Forced);: wq save and exit; I edit mode; v select; y copy yy line d Delete dd line; p Paste

? ? When editing, make changes based on your own file path. At the beginning, I did not change the file path and encountered the problem of missing installation files.

[Mysqld]
Datadir =/var/lib/mysql
Socket =/var/lib/mysql. sock
# Default to using old password format for compatibility with mysql 3.x
# Clients (those using the mysqlclient10 compatibility package ).
Old_passwords = 1 encode find this line, add a new rule below this line, let MySQL's default code as UTF-8
Default-character-set = utf8? Add this line to worker
Add the following statement at the end of the configuration file:
[Mysql]
Default-character-set = utf8

?

3. create databases and tables

#/Etc/rc. d/init. d/mysqld start? // Start the database

# Mysql-hlocalhost-uroot-p? // Login

?

? (1) create database test;

? ? ? ? ? ? ? ? Show? Show databases;

? ? ? ? ? ? ? ? Delete? Drop database test;

? (2) create a table, use test;

? ? ? ? ? ? Be sure to create a primary key. I didn't set the primary key at first, and an error is returned.

? ? ? ? ? ? ? ?? Create table pet (

? ? ? ? ? ? ? ?? Id int primary key,

? ? ? ? ? ? ? ?? Name varchar (20)

? ? ? ? ? ? ? ? );

?

Reference: http://www.blogjava.net/kxbin/articles/370374.html

? ? ? ? ? Http://www.cnblogs.com/Ray-xujianguo/p/3334573.html

? ? ? ? ?? Http://blog.csdn.net/lengyuhong/article/details/5865875

? ? ? ? ? Http://blog.chinaunix.net/uid-301743-id-3972489.html ??

?

?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.