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
Use Apmserv 5.2.6 build PHP environment, through the apmser.5.2.6 management MySQL database, will automatically enter the phpMyAdmin login interface, the root account password default is empty, enter the phpMyAdmin prompts need to modify root
Here is the file code for backing up the MySQL database via apache+php under Linux:File one, listtable.php (file lists all tables in the database for backup selection)Please select the table you want to back up:
The code is as follows
#将所有备份文件备份到指定的目录, such as/backup/mysql_data_backup
The code is as follows
Copy Code
Mkdir/backup/mysql_data_backup-pCd/backup/mysql_data_backupWget/backmysql.txt-o backmysql.phpchmod +x backmysql.phpCrontab-e
Several steps for PHP+MYSQL transaction processing:1. Turn off automatic submission2. Open transaction Processing3. The exception will automatically throw the exception prompt and roll back4. Turn on automatic submission
Note: MySQL has only this
Modify Password method
First, through the browser log into the phpMyAdmin console, click "Permissions",
Second, check the root user, and click "Edit Permission" later,
Third, in the open page in the middle position, find the "Change Password"
The SELECT statement is used to select data from the database.
Select data from a database table
The SELECT statement is used to select data from the database.
Grammar
SELECT column_name (s) from table_nameNote: SQL statements are insensitive to
Common connection function mysql_connect ()
Mysql_connect (Servername,username,password);
Long connection function Mysql_pconnect ()
Mysql_pconnect (Servername,username,password);
The code is as follows
Copy Code
$con
Phpexcel is a fairly powerful MS Office Excel document Generation Class library, and Phpexcel is a good choice when it comes to outputting more complex format data. But the way it's used is relatively tedious.
The code is as follows
1 Modify the PHP extension code to support PHP 5.4.x2) fixed the problem that the limit parameter of scws_get_tops in PHP extension does not allow less than 103) LIBSCWS add Scws_fork () from existing SCWS instances to generate branches and share
Novice initial examination, but also please the road Master a lot of guidance.
The program source code is as follows:
$conn = mysql_connect ("localhost", "root", "") or Die ("wrong!");$sel =mysql_select_db ("MyDB", $conn);$sql = "INSERT into '
Specific methods
1. Stop mysqld
1.
The code is as follows
Copy Code
Service Mysqld Stop
2. Modify MY.CNFIn [mysqld], change the datadir=/var/lib/mysql to Datadir=/home/mysql and change
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
Solution One
MySQL forgets super User password solution
If MySQL is running, first kill: Killall-term mysqld.
Start MySQL:
The code is as follows
Copy Code
Bin/safe_mysqld--skip-grant-tables &
You can get
I admit that I am not the leader in PHP. However, after reading some PHP information, I think some functions need to be added to it to process database connections and integrate XML. To do this, I think I can create a class to process MySQL
Use the following command to create a mysql account with various permissions ):1. create a user and have the permissions to create a database, modify fields, delete tables, add, delete, modify, and query tables, and to allow remote and even remote
For example, in linux$2 User column in the second horizontal column The code is as follows:Copy code For I in $ (mysql-uroot-p123456-se "show processlist" |Awk '{if ($2 = "admin") print $1}'); do mysql-uroot-p123456-e "kill $ I"; doneExample:
Mysql commandUse [LIKE wild];Show tables;Show databases;? /Help;Exit/quit;Mysqladmin version;Mysql mysqladmin version;Net start mysql;Mysqladmin variables;Mysqladmin-h hostname -- port = port_number variables;By default, the port is 3306 and the
Tutorial on installing MySql + Apache2 + PHP5.3.1 in LinuxDownload the following three necessary software 01-04php-5.3.1.tar.gz.html ">Php-5.3.1.tar.gz installation package download01-04Httpd-2.2.14.tar.gz installation package download01-04mysql-5.1.
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