OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



DB error on install: access denied

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

DB error on install: access denied

Postby eamoore » Fri Jul 15, 2011 3:19 pm

Hi, all,

I'm trying to get OJS installed and running into this error:

ojs2: DB Error: Access denied for user 'myuserid'@'localhost' (using password: NO)

Is the OJS install process trying to create the database (and failing to set it up using the userid given for some reason)? Or do I need to create the database myself, prior to starting the OJS install process? Or is something else going on here? If it's relevant, I'm running:

mysql: 5.0.45-22.9
Apache2: 2.2.4
php5-5.2.11

Any help you can give me will be gratefully received...

Thanks much!

-Emily
eamoore
 
Posts: 3
Joined: Tue Jun 14, 2011 6:10 pm

Re: DB error on install: access denied

Postby JasonNugent » Fri Jul 15, 2011 4:25 pm

Hi Emily,

The interesting part of your error message is that it's not attempting to use a password. The user that OJS will attempt to connect to your database server with must already exist. This user is normally created by the MySQL root user with a GRANT command. Do you know if this was already done? The MySQL root user can also create the database for your OJS installation at the same time. Usually, with two commands, from the MySQL command line (or some other tool like PHPMyAdmin):

CREATE DATABASE ojs;
GRANT ALL ON ojs.* TO yourUser@localhost IDENTIFIED BY 'yourpassword';

Once that's done you can fill in the bits and pieces during the OJS installation. In my example, the name of the database is 'ojs', the user name is 'yourUser', the MySQL host name is 'localhost', and the user's password is 'yourpassword'. (all without the quotes).

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 895
Joined: Tue Jan 10, 2006 6:20 am

localhost (Was: Re: DB error on install: access denied)

Postby eamoore » Mon Jul 18, 2011 11:55 am

Hi, Jason,

Thanks for the reply!

From your post, it sounds as though I do need to do a bit of setup in MySQL first, before I attempt to run the OJS install. I was pretty sure that the userid/password I was using was setup in MySQL and had db create permissions, but I'll doublecheck and try the OJS install again.

Just to make sure I understand, what does "localhost" refer to? The Web server, the db server, the database about to be created, or....? "localhost" came up in the install process and I wasn't sure what it meant.

Thanks again,

-Emily
eamoore
 
Posts: 3
Joined: Tue Jun 14, 2011 6:10 pm

Re: DB error on install: access denied

Postby JasonNugent » Mon Jul 18, 2011 1:45 pm

Hi Emily,

In that case, 'localhost' is where the user would be connecting from. Traditionally, if MySQL and Apache are hosted on the same server, localhost is fine. It's a common way to represent "whatever the current machine is", in UNIX parlance.

Regards,
Jason
JasonNugent
Site Admin
 
Posts: 895
Joined: Tue Jan 10, 2006 6:20 am

Re: DB error on install: access denied

Postby darryl » Thu Jul 05, 2012 5:57 pm

hi guys,

It the same problem that I encounter on my Installation, I am a newbie. I'm working in one of the institution in my country, I am connected in the Research and Publication Office as Research Webmaster.

But Our Website stored in WordPress, we have many Journals that are online, and one of the Journals is cited by Thomson Reuters, We passed for the standard of Thomson, but as a Webmaster I evaluated our website but it's not to be good to stored a journals here, cause the WordPress is Blog Site. So, My plan right now is to change our site to OJS system, this System Introduced for my friend, that the OJS are the good storage of the journals, and we are applying for Crossref agency of Digital Object Identifier. Our database is JustHost.

anyone can help me to Install this system in localhost and our server.

I am using XAMPP now.

Pre-Installation Steps

1. The following files and directories (and their contents) must be made writable:

config.inc.php is writable (optional): Yes - how to change this to NO
public/ is writable: Yes
cache/ is writable: Yes
cache/t_cache/ is writable: Yes
cache/t_compile/ is writable: Yes
cache/_db is writable: Yes - how to change this to NO

2. A directory to store uploaded files must be created and made writable (see "File Settings" below).

Errors occurred during installation:

A database error has occurred: Access denied for user 'ojs'@'localhost' (using password: NO)

3. http://asianscientificjournals.com/ojs/ ... ex/install (mydomain: http://asianscientificjournals.com
I try to Install in my domain, I created the database in my CPanel but the problem is the same in local installation.

4. README instructions. I read this but the problem it's not solve.

This the hardest part my life to Install a OJS.
Last edited by darryl on Sun Dec 09, 2012 6:14 pm, edited 1 time in total.
darryl
 
Posts: 96
Joined: Wed Jul 04, 2012 6:52 pm
Location: Cagayan de Oro , Misamis Oriental Philippines

Re: DB error on install: access denied

Postby ramon » Fri Jul 06, 2012 10:21 am

Hello Darryl,

If you're a newbie at Web development, then you should read first about MySQL, Apache and PHP so you can understand what each do and how they work together to create what used to be called "dynamic" web sites (dynamic because they load data from databases, not because of animations of flashy things on screen), which also gave them the more correct name data-driven websites.

Usually XAMPP, run in local Windows machine, installs MySQL with user "root" without password, which is unsafe, but since the machine is not a server, it's ok.
In your server, you need to inform in the following section of ojs/config.inc.php the correct data (all these are defined in the installation form!!):
;;;;;;;;;;;;;;;;;;;;;
; Database Settings ;
;;;;;;;;;;;;;;;;;;;;;

[database]
; if you're running MySQL, otherwise it will be PostgreSQL
driver = mysql

; some hosts use a different address for the MySQL server. You should have that info in your CPanel
host = localhost

; this is the user that has grants on the databases in MySQL. If this user can create databases, all you need to inform next is the database name. Otherwise, the database will need to be created first!
username = MySQLuserName

; this is the password the MySQL user needs to access MySQL. In a local machine with XAMPP, you'll probably leave this blank, unless you added passwords to users.
password = MySQLuserName Password

; this is the database name, to be created by the MySQL user, if it has powers to, or the previously created database. Try not to use OJS as a database name.
name = databasename


Other essential settings for the install to be correct are the following:
  1. ; Client output/input character set
    client_charset = utf-8
  2. ; Database connection character set
    ; Must be set to "Off" if not supported by the database server
    ; If enabled, must be the same character set as "client_charset"
    ; (although the actual name may differ slightly depending on the server)
    connection_charset = utf8
  3. ; Database storage character set
    ; Must be set to "Off" if not supported by the database server
    database_charset = utf8
  4. ; Enable character normalization to utf-8 (On recommended)
    ; If disabled, strings will be passed through in their native encoding
    ; Note that client_charset and database collation must be set
    ; to "utf-8" for this to work
    charset_normalization = Off
  5. A folder to store submissions needs to be created, preferably outside of the public web, but Apache and PHP need to have access to this folder.
    files_dir = /home/user/files
  6. ; Make sure this file exists and has the correct file definition settings. In latest Ubuntu distros, this file has come empty...
    mime_database_path = /etc/magic.mime
  7. ; The encryption (hashing) algorithm to use for encrypting user passwords
    ; Valid values are: md5, sha1
    ; Note that sha1 requires PHP >= 4.3.0
    encryption = sha1

On a Windows environment, you won't need to worry much about file permissions.
On your server, if you only have FTP access, setting the permissions will be a littler trickier.

The OJS folder can be set to 644 (least available permissions), with 775 (max write permissions to set) in internal folders "public", "cache", "plugins", "locale" and "lib/pkp/locale" (if you want to install plugins and use the Translation and Custom Translation plugins via the Web interface to save the locale.xml files) but working like this will depend on server settings as well!

The cache folder NEEDS to be writable by the Apache user (usually "nobody", "www-data" or "apache").
Search this forum or the Web for how to set permissions and ownership (on linux servers you use the chmod and chown commands, search for these on the web and this forum!)

Also, take a look at this page

The error message you are seeing in your install is that you probably don't have a MySQL user named "ojs".
The default info is just for exemplifying what needs to be informed.

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 940
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: DB error on install: access denied

Postby darryl » Sun Dec 09, 2012 6:13 pm

ramon wrote:Hello Darryl,

If you're a newbie at Web development, then you should read first about MySQL, Apache and PHP so you can understand what each do and how they work together to create what used to be called "dynamic" web sites (dynamic because they load data from databases, not because of animations of flashy things on screen), which also gave them the more correct name data-driven websites.

Usually XAMPP, run in local Windows machine, installs MySQL with user "root" without password, which is unsafe, but since the machine is not a server, it's ok.
In your server, you need to inform in the following section of ojs/config.inc.php the correct data (all these are defined in the installation form!!):
;;;;;;;;;;;;;;;;;;;;;
; Database Settings ;
;;;;;;;;;;;;;;;;;;;;;

[database]
; if you're running MySQL, otherwise it will be PostgreSQL
driver = mysql

; some hosts use a different address for the MySQL server. You should have that info in your CPanel
host = localhost

; this is the user that has grants on the databases in MySQL. If this user can create databases, all you need to inform next is the database name. Otherwise, the database will need to be created first!
username = MySQLuserName

; this is the password the MySQL user needs to access MySQL. In a local machine with XAMPP, you'll probably leave this blank, unless you added passwords to users.
password = MySQLuserName Password

; this is the database name, to be created by the MySQL user, if it has powers to, or the previously created database. Try not to use OJS as a database name.
name = databasename


Other essential settings for the install to be correct are the following:
  1. ; Client output/input character set
    client_charset = utf-8
  2. ; Database connection character set
    ; Must be set to "Off" if not supported by the database server
    ; If enabled, must be the same character set as "client_charset"
    ; (although the actual name may differ slightly depending on the server)
    connection_charset = utf8
  3. ; Database storage character set
    ; Must be set to "Off" if not supported by the database server
    database_charset = utf8
  4. ; Enable character normalization to utf-8 (On recommended)
    ; If disabled, strings will be passed through in their native encoding
    ; Note that client_charset and database collation must be set
    ; to "utf-8" for this to work
    charset_normalization = Off
  5. A folder to store submissions needs to be created, preferably outside of the public web, but Apache and PHP need to have access to this folder.
    files_dir = /home/user/files
  6. ; Make sure this file exists and has the correct file definition settings. In latest Ubuntu distros, this file has come empty...
    mime_database_path = /etc/magic.mime
  7. ; The encryption (hashing) algorithm to use for encrypting user passwords
    ; Valid values are: md5, sha1
    ; Note that sha1 requires PHP >= 4.3.0
    encryption = sha1

On a Windows environment, you won't need to worry much about file permissions.
On your server, if you only have FTP access, setting the permissions will be a littler trickier.

The OJS folder can be set to 644 (least available permissions), with 775 (max write permissions to set) in internal folders "public", "cache", "plugins", "locale" and "lib/pkp/locale" (if you want to install plugins and use the Translation and Custom Translation plugins via the Web interface to save the locale.xml files) but working like this will depend on server settings as well!

The cache folder NEEDS to be writable by the Apache user (usually "nobody", "www-data" or "apache").
Search this forum or the Web for how to set permissions and ownership (on linux servers you use the chmod and chown commands, search for these on the web and this forum!)

Also, take a look at this page

The error message you are seeing in your install is that you probably don't have a MySQL user named "ojs".
The default info is just for exemplifying what needs to be informed.

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT



Hi Ramon,

Thanks for your reply, it's to late to say thank you for your instructions to install.. I get it's last 4 months ago..
so now on my focus is to customize my ojs system..

Best Regards,
Darryl
darryl
 
Posts: 96
Joined: Wed Jul 04, 2012 6:52 pm
Location: Cagayan de Oro , Misamis Oriental Philippines

Re: DB error on install: access denied

Postby ramon » Mon Dec 10, 2012 7:40 am

Hello Darryl,

Good to know you're on your way!!!

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 940
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 3 guests