Problems encountered during development

Source: Internet
Author: User

Problems encountered during development
Mysql Field Auto-Increment

In mysql, only one field can be set as an auto-increment field in each table. This field can be a primary key or a primary key. If it is not a primary key, it must be set as a key )",

Linux Command ps aux

In linux, You can query the processes using the ps and grep. For example, ps aux | grep httpd is used to query the account used by the httpd process.

Linux assigns folder permissions to a specified user

In linux, if you want to assign folder permissions to a user, you can use the chown command:
Chown-R apache. apache/data/www/project/can be used to change the owner group of all files and directories under/data/www/project/to an apache account.

MySQL encoding settings

I was killed by MySQL coding today. I wasted an afternoon working on Chinese Garbled text,
First, describe my problems:
Use the ssh client tool to insert data using SQL commands on windows,
The ssh tool uses SecureCRT 7.1, and the Session Options option is set to UTF8 encoding,
Then, when I use SQL commands to query the database, I can see normal Chinese data (this operation makes me mistakenly think that the data I inserted is UTF8 without garbled characters), and then when I query the database in PHP, the data displayed on the php page is garbled and it is preliminarily determined that there is a problem with the mysql encoding configuration,
According to the solution on the Internet:
Check the database encoding configuration first:

SHOW VARIABLES LIKE 'character_set_%';

After checking, we found that it was not utf8.
Then modify it:
Find the my. cnf file,
Find [mysqld] In the my. cnf file to add:

default-character-set=utf8init_connect='SET NAMES utf8'

Then restart the mysql service.
If default-character-set = utf8 causes mysql to fail to start, your mysql version can only support

character-set-server=utf8

At this time, I used the SQL command of the ssh client to query the data and found that the data I inserted was garbled.

There are other encoding settings:
Modify

default-character-set=utf8

In the configuration file "/var/lib/mysql/mydb/db. opt ",

default-character-set=utf8default-collation=utf8_general_ci

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.