Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
How to reconnect database
Sorry, I have accidentally deleted config.php, and then replaced it by wrong one while upgrading Textpattern 4.72 to 4.8.0.
Now I am getting only ‛Database unavailable.’ trying to access /textpatter/ by a browser.
config.php contains ‛user’ and ‛pass’ to access the back-end /textpattern/, and ‛db’ for the name of MySQL database only, without its password, right? Where and how I could input the password of a database?
Offline
Re: How to reconnect database
Should I make the clean install instead of upgrade now? Or will the clean install destroy my website?
Offline
Re: How to reconnect database
Vienuolis wrote #322002:
Sorry, I have accidentally deleted config.php, and then replaced it by wrong one while upgrading Textpattern 4.72 to 4.8.0.
Now I am getting only ‛Database unavailable.’ trying to access /textpattern/ by a browser.
config.php contains ‛user’ and ‛pass’ to access the back-end /textpattern/, and ‛db’ for the name of MySQL database only, without its password, right? Where and how I could input the password of a database?
No, the user and pass you need are for accessing MySQL (or the MySQL user that has access to your database). You get that from your host’s control panel or your MySQL admin.
Then you just need to give the name of the database. It should then work/upgrade immediately. No need to reinstall.
BTW: It’s always a good idea to make a backup of the database before upgrading.
TXP Builders – finely-crafted code, design and txp
Offline
Re: How to reconnect database
Vienuolis wrote #322003:
Should I make the clean install instead of upgrade now? Or will the clean install destroy my website?
do you have backups of the DB ? Hopefully you do. Try and rool back to pre upgrade status.
example config file should have :
<?php $txpcfg['db'] = 'dbname_txp'; $txpcfg['user'] = 'user'; $txpcfg['pass'] = 'mypassword20'; $txpcfg['host'] = 'localhost'; $txpcfg['table_prefix'] = ''; $txpcfg['txpath'] = '/home/path/apps/bobeep_app/textpattern/'; _Yours will vary_ $txpcfg['dbcharset'] = 'utf8'; define('PROTOCOL', 'https://'); ?>
…. texted postive
Offline
Re: How to reconnect database
Thank you for the help, jacob. Sorry, I have reinstalled and destroyed my website. My theme assets are in the place, but a database is doubled by the similar _prefixed tables. I have no idea what to deal now. Although I have all access rights to my server.
Offline
Re: How to reconnect database
I have the database backup, and all access rights, but how to reconnect Textpattern to MySQL? Reinstallation refuses to connect, requires an empty database or prefixed old, which appears as an empty one.
Last edited by Vienuolis (2020-02-29 18:00:46)
Offline
Re: How to reconnect database
If you use phpMyAdmin, you may drop (delete) all tables of the empty, installed db and then use the import function to replace it with the old db.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: How to reconnect database
You can run multiple sites from a single database. Just specify a different prefix during installation – I do it all the time.
Offline
Re: How to reconnect database
Problem solved, my fellow friend helped, thank you all, too!
Offline
Re: How to reconnect database
If your previous site is still intact with its original table prefix, then simply add the table prefix in this line of the config.php:
$txpcfg['table_prefix'] = 'your-prefix';
As Michael said, you can run several textpattern installations in parallel using different prefixes for each.
…
If you are trying to use your old textpattern database that used to have a prefix and now want to use it without a prefix on a database of its own, export your database file to an sql file (unzipped) and then open it in a text editor. You should see in front of every table creation or insert statement, your prefix in the text file. Search for that prefix and replace it with nothing, then save the sql file.
You can now reimport that into a blank database and you should have your database now without a table prefix. In your config.php you should remove any table prefix, e.g. $txpcfg['table_prefix'] = '';
.
TXP Builders – finely-crafted code, design and txp
Offline
Pages: 1