Home > Database > phpMyAdmin > How to upload a large database in phpmyadmin

How to upload a large database in phpmyadmin

Release: 2019-12-25 11:42:04
Original
2678 people have browsed it

How to upload a large database in phpmyadmin

phpmyadmin is a very convenient mysql database management tool that can be used to manage mysql database, import, export, etc.

phpmyadmin has a problem when importing mysql. If the database file to be imported is relatively large, the import will fail. The following introduces a method to import a mysql database of any size. The steps are as follows:

1. Upload the SQL file of the database to the root directory of the website through FTP

2. In the root directory of the website directory, create the file import.php.

3. Access this import.php in the browser. Suppose your website domain name is www.a.com, then access http://www.a.com/import.php in the browser. , As soon as the browser starts to access this import.php file, the data will start to be imported

4. After the data import is completed, the words "import ok" will appear on the screen

import.php The content of the file is as follows:

<?
system("mysql -uroot -pmypassword database < a.sql");
print "import ok";
?>
Copy after login

where root represents the database user name, mypassword represents the password of root, database represents the name of the database to be imported, a.sql represents the file name of the database file, which is decompressed document. These variables can be modified according to actual conditions.

PHP Chinese website has a large number of free phpmyadmin introductory tutorials, everyone is welcome to learn!

The above is the detailed content of How to upload a large database in phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template