0

I finished a WordPress project. I already uploaded all the files through FTP, now I have to import the database, but the client doesn't want to give me access to Cpanel.

How can I import / upload the database?

My client shared with me database name, database user and database password.

2 Answers2

1

I see the following alternatives, however they may work or not depending on how the server is configured.

  • If the web server has the mysql executable installed, you may be able to upload the dump via FTP and run the executable from a temporary PHP script:
<?php
passthru ("mysql -h $db_host -D $db_name -u $db_user -p$db_password -e 'source ./dump.sql'", $return_var);
if ($return_var === 0) unlink (__FILE__);
0

on top of what Anderson said , I will suggest to try pluggin for migration or backup and restore, so we don't endup in this kind of blocking access issues.

here are two pluggin i use mostly for similar requirement.

https://wordpress.org/plugins/duplicator/ https://wordpress.org/plugins/all-in-one-wp-migration/