Creating a new database is not working at server in codeigniter 3 |
@InsiteFX
Which username and password should I supply to create a new database using code please? I have supplied both my running database user username and password and cpanel username and password. But it did not work. Can you please show me what exactly you are saying? Thank you
Using Codeigniter since 2016 ( skype: imranertaza )
You can test your database connection using this code.
PHP Code: <?php For dbForge you can try this. PHP Code: // You can also pass another database object to the DB Forge loader, I think your problem is that your trying to create a new database but it is using the default database settings. Please let us know how you make out on this issue. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
@InsiteFX
Hi if you see this post. https://stackoverflow.com/questions/7223...eigniter-3 I have tried creating a new databse with new user. I have created new user with giving all permission so that this user can have access to this. Here is the code: PHP Code: $newDb = 'shohoz_hishab_backup_'.date('Y'); Thank you
Using Codeigniter since 2016 ( skype: imranertaza )
As I said before you need to create a seperate config for a new database in app/Config/Database.php
otherwise Database Forge, or it will use the default database group. PHP Code: /** What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
@InsiteFX
ok, If I have to create a seperate config for a new database, I have to create a new database manually with user and password using cpanel. right? Then I have to set the new config for the new database in the app/config/database.php After that I can take that yearly closing to the new database. This is what you are saying. Am I right? Thank you
Using Codeigniter since 2016 ( skype: imranertaza )
You should be able to create a new database using Database Forge using your admin login and password..
Try using those in the new database config file and see if you can create it. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Are you able to add a new database in cPanel?
Either using the cPanel MySQL Databases section or in cPanels phpMyAdmin....
@JustJohnQ
No. Not yet. It did not work still now. If you find any solution for that, please help me. Thank you @InsiteFX Hi you told me to create a seperate config for a new database in app/Config/Database.php Do I have to create that before using the Database Forge? Thank you
Using Codeigniter since 2016 ( skype: imranertaza )
It maybe that your hosting provider only allows the databases to be created in CPanel.
My provider allows me to create them through code. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |