Welcome Guest, Not a member yet? Register   Sign In
Database Error (Probably the Privileges)
#1

[eluser]Sky Warden[/eluser]
Hi there everyone! I’m new to the community, so please forgive me if there’s any mistake in post formatting.

I have a small problem with MySQL. I’m using XAMPP in my Linux Ubuntu 12.10 (for some reasons). I’ve put my CI, which I developed earlier in Windows XP, in the Ubuntu and it worked properly.

This is what I want to do. I have a database, just call my_stream and make a user named my_stream to access the database. I give the user all privileges on that database (yes, I’m rather lazy) but don’t give any global privilege (which I think is the issue).

I’ve put the correct username, password (it has no password at the moment, so I just leave it ‘’), and database. The problem is, I get this error :

Unable to select the specified database: celestial_stream

Filename: core/Loader.php

Line Number: 346

At first, it worked fine, but then stopped working for an unknown reason. After deleting and remaking the user, it worked, and stopped again. Then it stopped at all, still with the same error. I don’t think it’s the engine or invalid database name because if I use root, it works perfectly fine.

Another thing, when I put password to the new user, it says :

Unable to connect to your database server using the provided settings.

I’ve browsed the internet, and most of them were just wrong database name, typos, etc, but I’m sure mine isn’t. It works perfectly with the root (and my root has a password), so I think it’s just the privilege.

This is my database.php in the config folder :
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'my_stream';
$db['default']['password'] = ''; # This is actually two single quotes with no space.
$db['default']['database'] = 'my_stream';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

I think the trouble is in the privilege. The user has no global privilege (which is likely the problem), but I give it all privilege to the database. Still, I put no table specified privilege. I know I’m suck at managing privileges. Usually I just give people the script, make the database structure, and simply access it with root. Now I want something more secured and well, this is it. I will appreciate any help on setting the right privilege for a user.

When I log to phpMyAdmin with my_stream user, it shows no my_stream database, but with root, I can see the privilege in the my_stream database, and my_stream user is there.

If you need more information about my question, just say and I will add it right away. Thank you!
#2

[eluser]TheFuzzy0ne[/eluser]
Since this is just your development server, which I assume is inaccessible to the outside world, why can't you just use your root login until you can figure this out?

Setting up a database through PHPMyAdmin is fairly simple, but difficult to talk someone through without writing a tutorial. This might point you in the right direction: http://www.infosolutionsgoa.com/tutor/ph...ement.html
#3

[eluser]Sky Warden[/eluser]
[quote author="TheFuzzy0ne" date="1363351088"]Since this is just your development server, which I assume is inaccessible to the outside world, why can't you just use your root login until you can figure this out?

Setting up a database through PHPMyAdmin is fairly simple, but difficult to talk someone through without writing a tutorial. This might point you in the right direction: http://www.infosolutionsgoa.com/tutor/ph...ement.html[/quote]

Thanks for the reply. I did it the same way, and I did it again exactly the same way like the tutorial says. It still doesn't work.

I've never got this kind of trouble before I moved to Ubuntu. I used AppServ in Windows before, and it worked properly. Dunno with this one. I just installed the XAMPP and it worked at first. After some days, this strange thing happened.

I know that. I'm still using my root to develop the website, etc, but this small issue really takes my interest. How can I say I'm a programmer if I don't know how to fix this? :lol:




Theme © iAndrew 2016 - Forum software by © MyBB