Jump to content

user privilidges


chiprivers

Recommended Posts

I have downloaded and installed Server2Go which is a self configurating webserver comprising of Apache, PHP and MySQL that can be run from a USB memory stick or CD-Rom.

I am having trouble creating a new database, when I try using this:

CREATE DATABASE database_name

I get this error:

ERROR 1044 (42000): Access denied for user ''@'%' to database 'database_name'

I am logged in as root user so I thought that should give me access to create a new database, how do I amend this?
Link to comment
Share on other sites

you need to make a MY SQL user name and password, then u neeed this user name and password to log in to php my admin and make databases or log in to the command line of mysql using ur mysql username and password, php my admin needs to be installed (its a web application u can dl it) try searching for my.ini and configuring that whith a password and username or look in to the manual of servertogo and check how to make a mysql username and password
Link to comment
Share on other sites

ur script is fine, but obviously the error saying access denied for nothing @ nothing means either u have not set the host to localhost or the command u wish to use requires you to state these, when ur command works it will say root@localhost and it should work. So check to see if u have set the localhost as the mysql server host and check to see if u have set a password.

if you open the mysql databse, (mysql) and go to the users table, you can check if the root user exists and has a password,  if so it should be filled whith a thing called a hash that looks like kjgdh dfghdg lfdgd fkjg kinda for your password.
Link to comment
Share on other sites

[quote author=nadeemshafi9 link=topic=120597.msg495046#msg495046 date=1167709222]
ur script is fine, but obviously the error saying access denied for nothing @ nothing means either u have not set the host to localhost or the command u wish to use requires you to state these, when ur command works it will say root@localhost and it should work. So check to see if u have set the localhost as the mysql server host and check to see if u have set a password.

if you open the mysql databse, (mysql) and go to the users table, you can check if the root user exists and has a password,  if so it should be filled whith a thing called a hash that looks like kjgdh dfghdg lfdgd fkjg kinda for your password.
[/quote]

Sorry, not very good at this! If by this you mean from the mysql command you should have access to a database called mysql and within it a table called users, there isnt one? From the mysql command if I type show databases, there are none.
Link to comment
Share on other sites

Right, I have downloaded phpmyadmin and through this I can see my databases, despite them not being available through the mysql command prompt, it would appear that it has been created and a table within it. I am getting confused now!

I did a file search on my PC and it would appear that the databsae files have been saved to my PC in the following location:

C://MYS2GApp/Data/

Remember that I am working with Server2Go that runs Apache, PHP and MySQL from my flash drive so why it it not saving the data to $USB:Server2Go/Server/MySQL/Data/
and why is it not reading from the same place it is writing?
Link to comment
Share on other sites

If you can connect through phpMyAdmin then it proves your system is working! Good news!  What are the connection  details you used for phpMyAdmin, are they the same as the ones you used above?

Try creating a new database, username and password in phpMyAdmin and then re-run your script with these details.

I cant really comment much on your Server2Go USB stuff, but i would guess that as the USB stick is not the host, it places all the database files on the real host, possibly for faster access?
Link to comment
Share on other sites

When I went into phpmyadmin it was already connected to the data, I did not need to put any connection details in!

I can see why it may put the data onto the host computer instead of the USB but why would it then not read the data back from the host pc, it looks onto the usb for data and finds none?
Link to comment
Share on other sites

make the databse and check its permissions in phpMyAdmin. if there are no permissions on that DB then that means you have rights to access the db but ur mysql server is not set properly, it dosent know its host and does not hav a root user account. oh by the way u said u logged in to phpmyadmin without any credentials so that means there are no accounts in mysql,

phpmyadmin uses the root whith no password as default to log in so this is the account u have u have missed a setup phase of ur USB OS where the localhost is identified as the mysql host and a root password is set !!! this i think my freind is ur prob smack bang on

find out how to make a mysql account and check ur mysql server knows that its running on localhost, if you go to the mysql website shows you how to recover from a mysql root password loss, this will fix ur password hopfully cos rember its not a conventional server ur using and its not widley used, and why the hell do u want the server on a USB use knopix DSL (Dam Small Linux) i heard its one of the best.

after u sorted ur accounts and server you need to sort the config.php in phpmyadmin the one it uses if u got the latest version is phpmyadmin/libraries/config.default.php or somthing like that change the user to none and authentication to cookie, thsi will alow you to log in to phpmyadmin using ur new mysql account.
Link to comment
Share on other sites

Before I follow your instructions to correct the fault, will this set it up so that it storing the database on my USB and not the host PC? At the moment it is saving the data into a mysql folder it has created on the host PC but when querying data, it is looking for data in a mysql folder on the USB???

The reason I am trying to run a server off of a USB, and the reasons why the data needs to be both written and read from the USB, is because I want to be able to demnstrate work on PC's where there is no internet connection and/or a server running PHP and MySQL.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.