Last update at :2024-06-12,Edit by888u
When building a website with Linux VPS, if the database of the website is small, if I need to import the database to move the website or for other needs, Snail will definitely use phpmyadmin to import and manage database files online. When I moved a website today, the database size was over 100M. If I imported it online, I didn’t know how long it would take. And I found that the maximum database imported by online phpmyadmin is 50M.
In this case, I will use the SSH command to import the database, which is straightforward. Friends in need can just remember the following command:
Standard command: mysql -u database username -p database password database name Demonstration case: mysql -ulaozuo -plaozuo.org laozuo < laozuo.sql There is no explanation. Just look at the comparison above and you will know that -u and -p are directly next to each other, and there is no space between them and the username and password. But it should be noted that we need to first download the laozuo.sql database from outside and put it in the root directory of this website. The import will then be automatically detected. Similarly, how do we back up the database files? Standard command: mysqldump -u database username -p database password –default-character-set=encoding database name > database file name.sql Demonstration case: mysqldump -ulaozuo -plaozuo.org –default-character-set=gb2312 laozuo > laozuo.sql There are two issues that need to be noted here. The first is the encoding issue. According to the encoding of your website database, whether it is gb2312 or utf-8, and the database file name will be saved in the root directory of the website. Then we can download via FTP or wget. In this way, we can solve the problem of websites with large databases through the above import and backup database. It can achieve twice the result with half the effort. Recommended site searches: same IP site query, game high defense server, java virtual host, Korean independent server, multi-IP station group server, website server rental, IP reverse domain name check, free space application, the cheapest dual-line space ,bbs filing,
发表评论