chiprivers Posted January 1, 2007 Share Posted January 1, 2007 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_nameI 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? Quote Link to comment Share on other sites More sharing options...
the_oliver Posted January 1, 2007 Share Posted January 1, 2007 How are you connecting to your database? Quote Link to comment Share on other sites More sharing options...
chiprivers Posted January 2, 2007 Author Share Posted January 2, 2007 [quote author=the_oliver link=topic=120597.msg494867#msg494867 date=1167691712]How are you connecting to your database?[/quote]Not sure what you mean? Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted January 2, 2007 Share Posted January 2, 2007 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 Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted January 2, 2007 Share Posted January 2, 2007 if u are logged in as root user then it is probably the command u use to create a dataabse requires the credentials of root aswell, and have u told it that the mysql host is localhost so it can say user = root@localhost Quote Link to comment Share on other sites More sharing options...
chiprivers Posted January 2, 2007 Author Share Posted January 2, 2007 Used this PHP script to connect to database:[code]<?php$host = "localhost";$user = "root";$password = "";$connection = mysql_connect($host,$user,$password);?>[/code] Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted January 2, 2007 Share Posted January 2, 2007 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 Link to comment Share on other sites More sharing options...
chiprivers Posted January 2, 2007 Author Share Posted January 2, 2007 [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. Quote Link to comment Share on other sites More sharing options...
chiprivers Posted January 2, 2007 Author Share Posted January 2, 2007 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? Quote Link to comment Share on other sites More sharing options...
the_oliver Posted January 2, 2007 Share Posted January 2, 2007 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? Quote Link to comment Share on other sites More sharing options...
chiprivers Posted January 2, 2007 Author Share Posted January 2, 2007 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? Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted January 4, 2007 Share Posted January 4, 2007 ok php my admin connects auto and you are also getting nothing@nothing error, u have no users, anyone can access the server, you need to now find out how to make users on server2go for mysql, they got a forum aswell. and then do ur stuff but for know u can make databases cant u. Quote Link to comment Share on other sites More sharing options...
chiprivers Posted January 4, 2007 Author Share Posted January 4, 2007 [quote author=nadeemshafi9 link=topic=120597.msg496661#msg496661 date=1167891741]u can make databases cant u.[/quote]I can make databases but can't read from them! Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted January 5, 2007 Share Posted January 5, 2007 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 onfind 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. Quote Link to comment Share on other sites More sharing options...
chiprivers Posted January 5, 2007 Author Share Posted January 5, 2007 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. Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted January 10, 2007 Share Posted January 10, 2007 ok to sort where the data is its probs gona be in the my.ini but as i say server to go just might be very customly made. find the my.ini and do a search for data and see if there are any directives in there that might help. Quote Link to comment Share on other sites More sharing options...
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.