I am trying to move a working Drupal 6.14 (non-clean URLs) site that someone else developed to a new server. I have access to all files on the new server (SuSE10) and am running Apache 2 and PHP 5. I am a relative newbie to both Drupal and server administration. Thanks for any help in advance.
I am getting the error "Access denied for user 'user@localhost' (using password: YES)", where "user" is my actual username.
I have successfully created a database on the new server and loaded the database files from the working site into it using phpMyAdmin. I have a user/password in my MySQL user file that matches the info in my settings.php file:
$db_url = 'mysqli://user:password@localhost/name_of_database';
I have moved all of the Drupal files to the new server. I am running the new site as a VirtualHost and the server is working with other VirtualHosts. I have the following in my vhosts.d/sitename.conf:
<VirtualHost *:80>
ServerName sitename.com
ServerAlias *.sitename.com
DocumentRoot /srv/www/htdocs/sitename
ErrorLog /var/log/apache2/sitename.error.log
CustomLog /var/log/apache2/sitename.access.log combined
</VirtualHost>
<Directory "/srv/www/htdocs/sitename">
AllowOverride FileInfo Limit Options Indexes
Order allow,deny
Allow from all
</Directory>
And the following in my .htaccess file (taken from the working site):
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# uncomment and adapt the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
#
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id: .htaccess,v 1.90.2.3 2008/12/10 20:04:08 goba Exp $
I have tried commenting out the line "Options -Indexes" and "RewriteBase /" and restarting Apache after every change to no avail. I am not getting any errors in the Apache error logs. Can someone offer suggestions or point me to any resources? I see to have hit a dead end....
Comments
php myadmin
Did you install PHP myadmin or was it a plesk / control panel type of access.
It sounds like you do not have something quite right in your db connection but could not say for sure.
I've had similar happen and it ended up being that the webserver control panel had auto added something to my database name. I picked drupal_db as my db name and it added site_name_drupal_db and I could not connect as I was giving drupal_db to the drupal config
Yes, I did install phpMyAdmin
But, it didn't add anything to the name of the database as far as I can tell by looking at it in phpMyAdmin. It does seem something isn't right with the database connection, but I'm not sure where to go to figure that out. Thanks for the suggestion though!
Maybe problem with MySQL passwords?
I remember reading somewhere that Drupal has to use the older, shorter passwords for MySQL, so you have to choose "Old Password" under the function parameter for the password field in phpMyAdmin. I've tried all combinations but I still can't connect.
Wanted to add that my MySQL user has all privileges and that a number of other applications are running on this database, so I do know it works.
Finally got it working
I thought I had already done so, but flushing privileges on the database seemed to clear up the problem.
how to flush
hi i am new to drupal 7 i am also getting the same issue can u explain how to do flushing of database
From the command line: mysql
From the command line:
If you don't have command line access you should ask your host provider for help or use phpmyadmin.
In phpmyadmin, click the privileges tab, then click the link is at the bottom of the page.
Ezra Wolfe
DLC Solutions
EthosCE
thnx a lot
is there ny step by step documentation for migrating drupal 7 from localhost to remote server
views error
Fatal error: Cannot redeclare class views_object in /home/logumba/public_html/drupal7/sites/all/modules/views/includes/base.inc on line 12
i m getting this error after migrating my drupal 7 site from local host to remote server only home page is working if i click ny link it shows this error