MySQL
With XAMPP, permission denied for MySQL user with % (all) host access but works for localhost
For reasons not known to man nor beast, on XAMPP on Mac OS X (and not XAMP but another all in one WAMP stack, but not that name either) will not work with the wildcard availability host name (%). It will work (or anyhow may work for you, it worked for Agaric!) with the @localhost for host name.
In a shell script, create a database if it does not exist
Use the MySQL: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database_name'
<?php
if (mysql_num_rows(mysql_query("SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '". $dbname ."'"))) {
echo "Database $dbname already exists.";
}
else {
// go on and create the user, database, etc.
// create the user
Setting up MAMP to work for the same scripts we use on the Debian server
I changed the mysql root password through phpMyAdmin... and promptly lost the connection– no! The password also has to be changed in MAMP's phpMyAdmin configuration file.
vi /Applications/MAMP/bin/phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['password'] = 'changedpass'; // MySQL password (only needed
