Read MySQL Database
Cases.
The code is as follows
Copy Code
$link =mysql_connect ("localhost", "root", "previous admin password"); if (! $link) echo "No connection succeeded!"; mysql_select_db
Grammar
Mysql_connect (Servername,username,password);
Example
In the following example, we store a connection in a variable ($con) in a script for later use. If the connection fails, the "Die" section is executed:
The code is as
。 The method that invokes the stored procedure.
A. If the stored procedure has in/inout parameters, declare a variable, input parameters to the stored procedure, the variable is a pair of PHP variables (also can not, just do not have PHP variables,
The following is a description of the main content of the article.
The code is as follows
Copy Code
Found_rows (): SelectRow_count (): UPDATE Delete Insert
Note: You need to work with the appropriate operation,
The code is as follows
Copy Code
Database processing ClassesClass db{The data save variables after SQL execution;var $db;Reads or sets the location of the current datavar $position = 0;Execute the SQL statement and save the result
The code is as follows
Copy Code
$conn = mysql_connect (' localhost ', ' root ', ' password ');Var_dump ($conn);?>
The basic is to change the configuration file php.ini
First, make sure that the Extension_dir = "./ext" in
Backup MySQL with mysqldump
1. Establish the file path to back up
# Mkdir/opt/bak/mysql/cxyI am the library for the path, MySQL under the storage of multiple libraries, cxy for the library2. Create Backup script files# vi/usr/sbin/mysqlbak.shInput
The same website program runs under Linux more quickly than in Windows, so decided to use Linux distribution CentOS, this article mainly explained under CentOS use Yum command to install the lamp detailed process. The software we use is the latest
1. Install apache,mysql,php with Yum1.1 Installing Apache
The code is as follows
Copy Code
#yum Install httpd Httpd-devel
When Setup is complete, start Apache with/etc/init.d/httpd startSet to boot:
Installation of MySQL
The MySQL version used in this article is mysql-3.22.27.tar.gz (original code file), the operating environment is RedHat6.0 +cle0.8.
MySQL is installed by default to the/usr/local directory, but in order to remove the
Today, the website is accessible from databases. Maybe the website you maintain is connected to the MySQL database. MySQL is a relational database management system (RDMS). We know that with the database, your website will jump from a dead static
Today, old Zuo is preparing to migrate the website of a customer from the company to another server, and back up the latest webpage files and export the database according to the normal operation, then, create a site and database wget on the new
Note:If the server that enables MySQL binlog is not set to automatically clear logs, binlog logs are retained by default for a long time, and the server disk space is full of binlog logs, leading to MySQL database errors.Use the following method to
Sometimes when we insert data into the database, we need to determine whether a field exists. If yes, we need to perform the update operation. If no, we need to perform the insert operation. If each query first checks whether a field exists, it is
When mysql is installed, the star server cannot be started and is stuck in the following interface.Cause analysisThis problem was also encountered when I installed mysql. the INI file has not been copied successfully, we just need to in the mysql
I have mentioned in previous articles that mysql data dictionary restoration (using tools to extract MySQL data dictionary directly, without SYS_FIELDS tables). The main data dictionary is as follows, this article mainly explains the significance of
Using MYSQL for database backup has a very regular database backup method, which has the same concept as other database servers, but have you ever thought about it, mySQL will have a simpler backup method using the file directory, and it will be
1. How to obtain the latest MySQL version?To install MySQL, you must first obtain the latest version of MySQL. Although we all know that MySQL can be found in FreeBSD Packages, I suggest you go to the network to find the latest version of MySQL. I
I. Optimizing MySQL during compilationIf you distribute and install MySQL from the source code, note that the compilation process will have an important impact on the future target program. Different compilation methods may obtain similar target
If you forget your MYSQL root password, you can recover it through the following process.1. Send the kill command to the mysqld server to disable the mysqld server (not kill-9). The files that store the process ID are usually located in the
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