s_dastjani
Verified User
- Joined
- Jun 16, 2014
- Messages
- 6
hello
What's a config.php file after making a add new user and password database that can be edited?
config.php Is in public_html
I am using this code to create a database
And then I want to store variables in config.php file
code config.php
Thank
What's a config.php file after making a add new user and password database that can be edited?
config.php Is in public_html
I am using this code to create a database
And then I want to store variables in config.php file
Code:
# read mysql access stuff
DA_MYSQL=/usr/local/directadmin/conf/mysql.conf
DA_USER=`cat $DA_MYSQL | grep user= | cut -d= -f2`
DA_PASS=`cat $DA_MYSQL | grep passwd= | cut -d= -f2`
NEW_DB="${username}_db1"
NEW_USER="${username}@localhost"
# create database
mysql -u $DA_USER -p$DA_PASS --execute="CREATE DATABASE $NEW_DB"
#create user
mysql -u $DA_USER -p$DA_PASS --execute="GRANT ALL on $NEW_DB.* to $NEW_USER identified by '${passwd}'"
#create default user
NEW_USER="${username}_usr@localhost"
mysql -u $DA_USER -p$DA_PASS --execute="GRANT ALL on $NEW_DB.* to $NEW_USER identified by '${passwd}'"
code config.php
Code:
<?php
$database = "domain_domain"; //Datenbankname
$sqlhost = "localhost"; //Datenbank Hostname
$sqluser = "domain_domain"; //Datenbank Username
$sqlpass = "15824135113"; //Datenbank Passwort
?>
Thank