MSSQL Server and PHP connection
The code is as follows
Copy Code
$MCN = Mssql_connect (' 127.0.0.1 ', ' sa ', ' 1 ');mssql_select_db (' HB ', $MCN);
MySQL database connection
code is as follows
Test Libmysql tutorials are copied into windows/system32 and Libmysql.dll under Apache/bin.Of course, the most convenient way is:In Apache:LoadFile d:/php Tutorial/php5.2.13/libmysql.dllOnly above this line, MySQL can be successfully misappropriated.
First, we go to the official download mysql-connector-net-5.5MySQL's connector/net5.0 download address:Http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.0.6.zip/from/pickAfter the installation is ready,Point property, then point
Windows System configuration MySQL
Unable to connect to MySQL, wrote a test MySQL PHP file as follows:
The code is as follows
Copy Code
if (! $link) echo "Failed!";Elseecho "Success!" Mysql_close ();?>
Results
100m/versatile/mssql/mysql/ftp/can be bound rice space
Free universal SpacePrice: 0 RMB※ Web Space 100M, give a 20M database, limited resources, each user can only apply for one;※ Independent FTP Account 1, IIS connection is unlimited, the flow is
There are a number of third-party sources on the web, upgrade MySQL at the same time, will also upgrade PHP, if only want to upgrade MySQL look below1,mysql Official Source Address
Http://repo.mysql.com/yum
The latest is 5.7, see your preferences
MySQL is not enabled by default, so the Php_mysql.dll Dynamic Connection library must be activated in php.ini. In addition, PHP also needs access to the MySQL Client connection library. The Windows release of PHP includes a Libmysql.dll file that
Today
The code is as follows
Copy Code
SELECT * FROM table name where To_days (Time field name) =to_days (now ());
Yesterday
The code is as follows
Copy Code
SELECT * from '
Grammar
[CONSTRAINT [Symbol]] FOREIGN KEY[Index_name] (Index_col_name, ...)REFERENCES tbl_name (Index_col_name,...)[on DELETE Reference_option][on UPDATE Reference_option]
Reference_option:RESTRICT | CASCADE | SET NULL | The use of the NO ACTION
Automatically back up the database using mysqldump timing
The code is as follows
Copy Code
[Root@www www]# VI backup-db.sh#!/bin/sh/bin/nice-n 19/usr/bin/mysqldump-u vpsmysql--password=vpsmysqlpassword mysqlname-c | /bin/
Add user
Native access Permissions:mysql> GRANT all privileges on *.* to ' username' @ ' localhost '
-> identified by ' password ' with GRANT OPTION;Remote access permission:mysql> GRANT all privileges in *.* to ' username ' @ '% '
-> identified
Received a monitor message today that blog access failed. Open the page a look, the huge 502 bad gateway,ping a VPS found is pass, SSH connection up to see the Nginx log found no problem, restart Lnmp when found MySQL, the problem source basically
Problem analysis
Considering that it might be a program performance issue, I used the Xdebug performance Log function output program to run the log and found that the connection to MySQL function time actually used nearly 95% of the
The mysqld_safe that uses the binary compilation file starts the error as follows:
[MYSQL@ECP-UC-DB1 ~]$ Mysqld_safe110707 21:31:19 mysqld_safe Logging to '/opt/mysql/mysqldata/ecp-uc-db1.err '.110707 21:31:19 Mysqld_safe the
The number of connections exceeds the value set by MySQL and is related to both max_connections and wait_timeout. The larger the value of the wait_timeout, the longer the idle wait for the connection, which causes the current number of connections
MySQL to add new users can be done in two ways:
1. By way of the grant statement, we will explain this in the MySQL permissions below, which is simply an example.2. Direct operation of the MySQL authorization form (this method is now basically not
Suppose our table structure is as follows
The code is as follows
Copy Code
CREATE TABLE Example (example_id INT not NULL,Name VARCHAR not NULL,Value VARCHAR is not NULL,Other_value VARCHAR (m) not NULL)
First, limit the concurrent processing of innodb. If innodb_thread_concurrency = 0 can be changed first to 16 or 64 to see machine pressure, ifVery large, first changed to 16 to let the machine pressure down, and then gradually increase to adapt to
Record all the processes of the apache + mysql + php development environment compiled by source code under fedora core 1.Generally, installing a server with rpm is the most convenient. You can easily obtain the desired environment without
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