[Question] How to replace Database?

cupzJaYu

Junior Member
Joined
Aug 28, 2015
Messages
105
Reaction score
64
Hi everyone.
Newbie here..
sorry my english still bad.

I just bought script.
How to replace Database?
If, i dont have cpanel?

I use Server Pilot.

here the code..
Code:
<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "DBusername";
$db['default']['password'] = "DBpassword";
$db['default']['database'] = "DB";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "ads_";
$db['default']['active_r'] = TRUE;
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

?>

what should i do?

Thank you very much.
 
I understand you're waiting for an answer.

I don't have the answer but I have a suggestion.

You may want to post in the Hire a Freelancer section so they will take this seriously.
 
Sorry mate, if I understand your question, you bought a PHP Script for a website or anything.
Now you have the script but nothing to run it on? For the start and to test the script you could install apache and mysql local and setup the database in your config-file to your localhost. Otherwise get a vps or hosting with an own MySQL Database.
 
thank you for the answer.

i already have vps, digital ocean.
i already create database. (serverpilot)
name : test
username : 2816ae7fe238
password : 7e27ab9f09e586c2

and then....
DBusername replace to 2816ae7fe238
DBpassword replace to 7e27ab9f09e586c2
DB replace to test

and i got error..

An Error Was Encountered
Error Number: 1146

Table 'test.ads_configs' doesn't exist

SELECT name, `value` FROM ads_configs

i have no idea..
need more advice.

btw, i dont have skype.

thank you..
really appreciate..
 
Ok, i guess the script you bought got either a kind of init.sql file or a Installation.php . It seems that you need to create the tables first. And I am pretty sure it is not meant to do this by hand.
So check for some file which has create table statements or/and insert into statements.
The import the .sql file or open the install.php file in your browser.
 
I don't know buddy, if you have teamviewer or something I can help you set it up.. It's coded using Codeigniter PHP framework as I can see. There should be .sql file in script, just import it into mysql DB. Let me know if you need further help.
 
import your .sql file to the database first.
use CLI if you don't have cpanel installed.

I can help you import that database. but i believe That you can do it yourself just search "import mysql from command line". don't take the risk sharing any of your server credentials to anyone. unless you 100% sure you know that person.
 
every reply on this thread is a helpful clue.
but I think some people just wanted to be spoonfed step by step.
so here it is.

1. locate your sql dump file (.sql) that come with the script when you purchased them.

2. upload that .sql file to your vps/hosting/server (since you mentioned you dont have cpanel installed you could either upload it using scp or ftp client)

3. Login to your server/vps using ssh.

-- I assume that you already configured your mysql database server

4. change dir to wherever you upload your .sql file on step #2
4. Login to your mysql server using this command
#mysql -u [your db username] -p
hit enter
enter your password​

5. create your database with this mysql command

create database [your database name]​

6. exit from mysql server by typing q or exit and hit enter

7. Import your .sql file to your newly created database using this command


mysql -u [your db username] -p [your database name here] < your_sql_file_dump.sql

hit enter

enter your password
wait the process
done
hope you find this useful.
hmmm i was thinkiing i will see help here
 
Back
Top