baker7 Posted January 22, 2009 Report Share Posted January 22, 2009 Hello Everyone:Well, I have my server active, and I have solved one problem that is bothering me. Now, I want to install Wordpress 2.7. I have access to webmin to access the servers config, and I have added a database for the Wordpress blog, but when I set the mysql username and password to what it shows in the control panel, and add the info in the script, and try to install, it says:Error establishing a database connectionThis either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at 192.168.1.60. This could mean your host's database server is down.Are you sure you have the correct username and password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running? If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support ForumsI'm not sure if the username has to be the same one that is for user 'mysql' in the password file, but I did make a user "brian" and a password for that user and gave that user all rights. If necessary I will post the wp-config.php file, but I know that I have installed PhpMyadmin and webmin, so I know that mysql is running, I just cant get it connect to the database.any ideas??Brian Quote Link to post Share on other sites
Falcon1986 Posted January 22, 2009 Report Share Posted January 22, 2009 (edited) I do not have experience running WordPress on a local server, but I do have it installed on a web host.In the shared web hosting environment our database names usually look like this: account_databaseAnd the database user usually looks like this: account_userWhere "account" is the name of the shared hosting space and "account_user" has permissions to access "account_database".As a result, when it is time to specify the database and user in wp-config.php, here is what we must enter:define('DB_NAME', 'account_database');define('DB_USER', 'account_user');Also note that you must also enter the password that gives "account_user" the permission to access "account_database". 'DB_HOST' is usually just 'localhost':define('DB_PASSWORD', 'yourpasswordhere');define('DB_HOST', 'localhost'); Edited January 22, 2009 by Falcon1986 Quote Link to post Share on other sites
iccaros Posted January 24, 2009 Report Share Posted January 24, 2009 from the command line make a mysql connection with that username and password, if you have webmin you most likely have ssh access. Quote Link to post Share on other sites
baker7 Posted January 24, 2009 Author Report Share Posted January 24, 2009 I cannot seem to make a connection to the mysql server with any results: I get:root@Eliveserver[/var/www/brian/wordpress]# mysql -u brianERROR 1045 (28000): Access denied for user 'brian'@'localhost' (using password: NO)root@Eliveserver[/var/www/brian/wordpress]# mysql -u brian -pEnter password: ERROR 1045 (28000): Access denied for user 'brian'@'localhost' (using password: YES)root@Eliveserver[/var/www/brian/wordpress]# mysql -h 192.168.1.60 -u brian -pEnter password: ERROR 1045 (28000): Access denied for user 'brian'@'buddy-baker.us' (using password: YES)What am I doing wrong?? should I just post my wp-config.php file for someone to look at??Brian Quote Link to post Share on other sites
iccaros Posted January 25, 2009 Report Share Posted January 25, 2009 try root. your webmin probably did not create the user correctlyhttp://dev.mysql.com/doc/refman/5.1/en/adding-users.html Quote Link to post Share on other sites
baker7 Posted January 25, 2009 Author Report Share Posted January 25, 2009 try root. your webmin probably did not create the user correctlyhttp://dev.mysql.com/doc/refman/5.1/en/adding-users.htmlOK: will DELETE the 'brian' user and try again using these instructions, and will keep you posted as to the results Thanks for the help Iccaros Brian Quote Link to post Share on other sites
baker7 Posted January 25, 2009 Author Report Share Posted January 25, 2009 Iccaros: I created the user, and am STILL having problems with the setup: I connect from my machine to 192.168.1.60, which is the IP address of the elive server, which is also known as Eliveserver.buddy-baker.us. I placed the server's wp=config.php here for you to see. The passwords work, permissions seem OK, but the script cannot connect to the server:<?php/** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix, * Secret Keys, WordPress Language, and ABSPATH. You can find more information by * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing * wp-config.php} Codex page. You can get the MySQL settings from your web host. * * This file is used by the wp-config.php creation script during the * installation. You don't have to use the web site, you can just copy this file * to "wp-config.php" and fill in the values. * * @package WordPress */// ** MySQL settings - You can get this info from your web host ** ///** The name of the database for WordPress */define('DB_NAME', 'wordpress');/** MySQL database username */define('DB_USER', 'brian');/** MySQL database password */define('DB_PASSWORD', 'password_removed_for_security');/** MySQL hostname */define('DB_HOST', '192.168.1.60');/** Database Charset to use in creating database tables. */define('DB_CHARSET', 'utf8');/** The Database Collate type. Don't change this if in doubt. */define('DB_COLLATE', '');/**#@+ * Authentication Unique Keys. * * Change these to different unique phrases! * You can generate these using the {@link http://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service} * * @since 2.6.0 */define('AUTH_KEY', 'put your unique phrase here');define('SECURE_AUTH_KEY', 'put your unique phrase here');define('LOGGED_IN_KEY', 'put your unique phrase here');define('NONCE_KEY', 'put your unique phrase here');/**#@-*//** * WordPress Database Table prefix. * * You can have multiple installations in one database if you give each a unique * prefix. Only numbers, letters, and underscores please! */$table_prefix = 'wp_';/** * WordPress Localized Language, defaults to English. * * Change this to localize WordPress. A corresponding MO file for the chosen * language must be installed to wp-content/languages. For example, install * de.mo to wp-content/languages and set WPLANG to 'de' to enable German * language support. */define ('WPLANG', '');/* That's all, stop editing! Happy blogging. *//** WordPress absolute path to the Wordpress directory. */if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/');/** Sets up WordPress vars and included files. */require_once(ABSPATH . 'wp-settings.php');?>I am not sure what the problem is, but I cannot get wordpress to connect to the database at 192.168.1.60 if I do it from a web browser. any suggestions??Thanks,Brian Quote Link to post Share on other sites
iccaros Posted February 1, 2009 Report Share Posted February 1, 2009 the server that has mysql is different from the one with wordpress (yes?) if so it could be several issuesis iptables blocking the ports (try /etc/init.d/iptables stop ) on both boxes for testing..see http://www.cyberciti.biz/tips/how-do-i-ena...ase-server.htmlfor more on thatsorry it took a while.. I have been out of town. Quote Link to post Share on other sites
baker7 Posted February 1, 2009 Author Report Share Posted February 1, 2009 the server that has mysql is different from the one with wordpress (yes?) if so it could be several issuesis iptables blocking the ports (try /etc/init.d/iptables stop ) on both boxes for testing..see http://www.cyberciti.biz/tips/how-do-i-ena...ase-server.htmlfor more on thatsorry it took a while.. I have been out of town.Iccaros:No Problem!! The server that has MYSQL is the same as the onwe that has wordpress. Wordprerss is in my /var/www/brian directory. however, i did set up a virtual directory - not sure if that has anything to do with it, but I can connect to it from my computers - I just cant install wordpress.Will look at this info and see what the deal is, but wordpress support for this issue sucks Thanks,Brian Quote Link to post Share on other sites
iccaros Posted February 1, 2009 Report Share Posted February 1, 2009 then you need to remove the address and use localhostbut get back to mysqlfrom a root command line if you type mysql and nothing else does it let you in? if so change your username to root and remove all between the "" for the passwordby default mysql does not allow network access so root with no password is ok (as long as you locked down file level access in apache, and turned off other communications and moved ssh to another port )Sorry if we are repeating, but I need to startover to make sure I did not skip anything. also I would give your wordpress DB name a unique name. like mysite. they suggest WP_ and a name, This way if you end up hosting more than one site (using Vhost) you do not have to reconfigure, plus if someone gets into Mysql they have to guess the correct DB. well work on a different user after Quote Link to post Share on other sites
baker7 Posted February 3, 2009 Author Report Share Posted February 3, 2009 Iccaros:I actually got Wordpress Installed, but had to access PHPMyadmin, which was hard as hell, because I figured I would NOT be able to access it. I edited the file in in /etc/phpmyadmin (the config.inc.php) file to set the database to localhost and I also went into the PhpMyadmin to make a user called 'user' with ONLY access permissions to my database, called wordpress.After I did that, I made sure that I had permissions for 'localhost' on all db's associated with wordpress, entered 'user' as the database user, and left the password blank. I went to the server and did a (http://localhost/wordpress/wp-admin/install.php) and she Installed.Now, I want to make it so that I have my host pointed at 192.168.1.60 and when I do this, I want to be able to login as admin, and config the setup so I can blog, but with everything 'localhost' ot is hard to do. Can you help me fix this??Brian Quote Link to post Share on other sites
baker7 Posted February 3, 2009 Author Report Share Posted February 3, 2009 Iccaros:I actually got Wordpress Installed, but had to access PHPMyadmin, which was hard as hell, because I figured I would NOT be able to access it. I edited the file in in /etc/phpmyadmin (the config.inc.php) file to set the database to localhost and I also went into the PhpMyadmin to make a user called 'user' with ONLY access permissions to my database, called wordpress.After I did that, I made sure that I had permissions for 'localhost' on all db's associated with wordpress, entered 'user' as the database user, and left the password blank. I went to the server and did a (http://localhost/wordpress/wp-admin/install.php) and she Installed.Now, I want to make it so that I have my host pointed at 192.168.1.60 and when I do this, I want to be able to login as admin, and config the setup so I can blog, but with everything 'localhost' ot is hard to do. Can you help me fix this??BrianOK: Fixed the problem: this is how I did it.1. I changed all necessary setups to 'localhost' in all files necessary to make the install work properly.2. I logged in as root for access to PhpMyAdmin - Then created a dummy user called 'user' (Host is localhost) with no password and NO permissions on the database 'wordpress' other then 'usage', which apparently is what you get when you make a user with PhpMyadmin with No permissions given3. I logged in as admin, with the supplied password4. From there, went to general settings, and found the 'wordpress address field', which has "http://localhost/wordpress/" - changed this to 192.168.1.60, which is the address of my server for now. Also changed the Blog Address to this and Saved the info. Then I went to oddessy, and tried to login directly, and I was granted access based on the IP of the server. I tested it from my Vista Laptop and it works well.Thanks for the help. Is there any permission changes I should make to the files in /var/www/brian/wordpress to secure them, or is root root OK??Brian Quote Link to post Share on other sites
iccaros Posted February 4, 2009 Report Share Posted February 4, 2009 normally it should be apache apache if you are blogging you need to control comments. So for each page you make, ensure you set permissions for comments (you go to the bottom and there is a + next to it to expand.. ) Quote Link to post Share on other sites
baker7 Posted February 4, 2009 Author Report Share Posted February 4, 2009 normally it should be apache apache if you are blogging you need to control comments. So for each page you make, ensure you set permissions for comments (you go to the bottom and there is a + next to it to expand.. )Thanks, will check that out Brian Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.