0

I have a backup of a database that is more than 500MB and I need to restore on a server, but every time phpMyAdmin give me error.

I want to restore it by uploading the file in my server then from terminal move it to /mysql/data/ folder, but I don’t know the path for MySQL.

I changed PHP 7.3’s upload_max_filesize and post_max_size to 1000MB, but still have a problem when importing the database.

I have installed cyberpanel on my Ubuntu 20.04 LTS machine and want to upload the SQL dump. I received an error each time I tried to upload via the browser:

and the other one is:

Also, I have many databases in there, I found this command based on this tutorial:

mysql -u root -p[my_root_password] [mydatabase] < mydatabase.sql

This does not help me because I have serious questions:

  1. My database is under the domain name and there are lots of db on the server, how should I find the correct name?

  2. I have uploaded the file to my server, at the end of the command is < mydatabase.sql. I don't know how to state which database to import the data dump to.

I'm so confused…

1 Answer 1

1

There should be no need to write the SQL file directly to the MySQL directory. If you have the SQL dump in an uncompressed format, you can do something like this:

sudo mysql {database_name} < {sql_file}

Notes:

  1. Unless you have drastically modified your MySQL installation, you can connect as root just by using sudo mysql
  2. the name of the database is the last item in the connection string
  3. the SQL file must be in an uncompressed, readable format

So, if you are importing a file named shopwood.sql into the high_shopwood database, you would do this:

sudo mysql high_shopwood < shopwood.sql

This can be done with each database that you are migrating.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.