Some questions to note about operating the MySQL database in PHP 1. The exception to the semicolon
For MySQL, the first thing you have to keep in mind is that each line of its command is separated by a semicolon (;) As the end, but ... There is no
Setting up the database
The text or integer type of fields that we usually use in the database and the fields that need to save the picture are different in the amount of data they need to keep. The MySQL database uses specialized fields to hold
Copy Code code as follows:
mysql_connect ("localhost", "root", "1981427")//connection to the server at localhost, username root
?>
Copy Code code as follows:
@mysql_connect ("localhost", "root", "1981427")
Or Die ("Database
Plan to switch a website host, did not expect to encounter PHP and MySQL Chinese garbled problem.
The former foreign host used MySQL is the 4.x series, feel better, regardless of GBK and UTF-8 are not garbled, did not think of the new host MySQL is
FAQ Summary:
When we use Navicate Premiun to connect to a remote database, the following problems occur:
The author unifies own practice, summarizes has the following reasons:
1. The remote database service does not have a connection port open
MySQL often appears in the Chinese support unfriendly situation common error "illegal mix of collations for operation"
Let's do a regular set of what character sets are involved in the MySQL database
Character-set-server/default-character-set:
1. Download MySQL Community Server 5.6.14
2. Extract the MySQL compression package
Unzip the downloaded MySQL compression package to the custom directory.
3. Add Environment variables
Variable name: mysql_home
Variable Value: D:\Program
This example for you to share the CENTOS6.5 compiled MySQL 5.7.14 installation configuration method for your reference, the specific contents are as follows
MYSQL5.7.14 compilation is installed under the custom file path
Download installation
I modified it, can run normally, test environment for MYSQL5.0,XP
Key is set on the character set, set gbk,gb2312 test pass, UTF8 test failed
Set up database JJ before running the program, pay attention to the following parameters (modified for your
Copy Code code as follows:
Groupadd MySQL//set up MySQL user group
useradd-g mysql mysql//MySQL account set up
TAR-ZXVF mysql-x.x.xx.tar.gz//unzip MySQL
CD mysql-5.0.45//into the extracted MySQL directory
It is not safe to use MYSQL_PWD. See 6.3 Connection to the MySQL server.
The "MySQL" Customer uses the file named in the Mysql_histfile environment variable to hold the command line history, the default value of the history file is
Mysql>prompt \u@\h (\d) \r:\m:\s>
\u: Connecting Users
\h: Connecting the host
\d: Connecting to the database
\r:\m:\s: Show Current time
Mysql>prompt \u@\h (\d) \r:\m:\s>
Root@localhost (MySQL) 08:55:21> status
--------------
MySQL Ver 1
1, the int to varchar often use the concat function, such as concat (8, ' 0 ') to get the string ' 80 '
2. Convert varchar to int using CAST (a as signed) a as varchar type string
Summary: Type conversions, like SQL Server, are somewhat different
How do you install two or more MySQL on a single server? Below is the detailed procedure, together to learn to learn.
First, the environment
MySQL Package:
Mysql-5.6.31.tar
Mysql-5.5.32.tar
Operating system Environment:
CentOS Release 6.8
Software version:
Apache:apache_2.2.14-win32-x86-no_ssl.msi
1.apache2.2
Select Custom, and then configure the installation directory, the default down, after the installation of Apache. You can test it first,
Browser IP address input 127.0.0.1.
Create a new view.php file with the following contents:
Copy Code code as follows:
$link =mysql_connect ("localhost", "root", "previous admin password");
if (! $link) echo "No connection succeeded!";
else echo "Connection
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