XF 2.1 localhost to live server

dds115

Member
I'm trying to go from my xampp forum and copy it onto my hosting site. Is there a walk through for this?

I've copied all my files from htdocs to my webhosting, but when I try to import my database (with default settings) to my hosting provider I get the following error:

SQL query: -- -- Database: lambarch_dev -- -- -------------------------------------------------------- -- -- Table structure for table xf_addon -- CREATE TABLE xf_addon ( addon_id varbinary(50) NOT NULL, title varchar(75) NOT NULL, version_string varchar(30) NOT NULL DEFAULT '', version_id int(10) UNSIGNED NOT NULL DEFAULT 0, json_hash varbinary(64) NOT NULL DEFAULT '', active tinyint(3) UNSIGNED NOT NULL, is_legacy tinyint(3) UNSIGNED NOT NULL DEFAULT 0, is_processing tinyint(3) UNSIGNED NOT NULL DEFAULT 0, last_pending_action varchar(50) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

MySQL said:
#1046 - No database selected

Any help is appreciated!
 

spider

Active member
Create a new empty database on the live server. Give it a database-username and database-password as required

If the db is small (I'm assuming you have a dbname.sql file yes?) you can use it directly via phpmyadmin to 'import' it that way. If its larger and you don't want to mess about with SSH (command line) or a tool such as BigDump to import it, upload it above public_html so its outside visible web traffic then ask your host to import it for you. Most will do this I suspect. ? :)

If you do not have an .sql file of your database , what do you have ? The 'raw' files for the db (.myd / .myi etc etc) not a great way to do this! I've never tried that method I suspect it would lead to all kinds of interesting "difficult to fix" issues if you did and you'd need a VPS or Dedi no doubt to get access to that part of the filesystem on the live server.
 

dds115

Member
are you importing the db from your localhost?
can't you make a dump and import it in your webhosting and change config.ini?
Create a new empty database on the live server. Give it a database-username and database-password as required

If the db is small (I'm assuming you have a dbname.sql file yes?) you can use it directly via phpmyadmin to 'import' it that way. If its larger and you don't want to mess about with SSH (command line) or a tool such as BigDump to import it, upload it above public_html so its outside visible web traffic then ask your host to import it for you. Most will do this I suspect. ? :)

If you do not have an .sql file of your database , what do you have ? The 'raw' files for the db (.myd / .myi etc etc) not a great way to do this! I've never tried that method I suspect it would lead to all kinds of interesting "difficult to fix" issues if you did and you'd need a VPS or Dedi no doubt to get access to that part of the filesystem on the live server.

Sorry for the slow response, I didn't notice anyone responded :)

So I've now been able to import the database, but when I go to domain.com (where my forum is hosted) I get the following error:

Fatal error: Uncaught XF\Db\Exception: Access denied for user 'root'@'localhost' (using password: NO) in /home/lambarch/public_html/src/XF/Db/Mysqli/Adapter.php:160 Stack trace: #0 /home/lambarch/public_html/src/XF/Db/Mysqli/Adapter.php(28): XF\Db\Mysqli\Adapter->makeConnection(Array) #1 /home/lambarch/public_html/src/XF/Db/AbstractAdapter.php(60): XF\Db\Mysqli\Adapter->getConnection() #2 /home/lambarch/public_html/src/XF/Db/Mysqli/Adapter.php(113): XF\Db\AbstractAdapter->connect() #3 /home/lambarch/public_html/src/XF/Db/AbstractAdapter.php(516): XF\Db\Mysqli\Adapter->escapeString('options') #4 /home/lambarch/public_html/src/XF/Db/AbstractAdapter.php(494): XF\Db\AbstractAdapter->quote('options') #5 /home/lambarch/public_html/src/XF/DataRegistry.php(138): XF\Db\AbstractAdapter->quote(Array) #6 /home/lambarch/public_html/src/XF/DataRegistry.php(83): XF\DataRegistry->readFromDb(Array, Array) #7 /home/lambarch/public_html/src/XF/DataRegistry.php(226): XF\DataRegistry->get(Array) #8 /home/lambarch/public_html/src/XF/App.php(16 in /home/lambarch/public_html/src/XF/Db/Mysqli/Adapter.php on line 160

Do I need to change something in 'config.ini'? If so, can you tell me where that might be located? Sorry for the amateur questions, I'm really figuring this out as I go if you can't tell haha
 

Tri@de

Member
Your host sent you some data to connect to the db: host name, user and password. You have to write in the config file. I don't think he gave you the root user and without password. (as I read using password: No)
 
Top