LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-14-2010, 04:10 AM   #1
chetanmadaan
Member
 
Registered: Sep 2009
Posts: 30

Rep: Reputation: 15
Smile Mysql permisions problem.


I am using Joomla and a script within it.

That Script is suppose to copy tables from one DB to another.

Code:
Error(1) [1142] query [CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`]. DB Error: CREATE VIEW command denied to user 'localiz_master'@'localhost' for table 'test_users' SQL=CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`


Error [1142] retrying query [CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`]. DB Error: CREATE VIEW command denied to user 'localiz_master'@'localhost' for table 'test_users' SQL=CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`
localiz_master: name of the DB from which data is suppose to be copied.
jos_users: name of the table form the main DB.
localiz_master: user for the DB.
localhost: host
test_users: name of the table to be created.

we do have phpmyadmin but the user's table is hidden. can someone please tell us the SSH command we might run to make localiz_master user have access to all the databases.

thanks in advance.
 
Old 06-14-2010, 04:24 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by chetanmadaan View Post
I am using Joomla and a script within it.

That Script is suppose to copy tables from one DB to another.

Code:
Error(1) [1142] query [CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`]. DB Error: CREATE VIEW command denied to user 'localiz_master'@'localhost' for table 'test_users' SQL=CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`


Error [1142] retrying query [CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`]. DB Error: CREATE VIEW command denied to user 'localiz_master'@'localhost' for table 'test_users' SQL=CREATE OR REPLACE VIEW test_users AS SELECT * FROM `localiz_master`.`jos_users`
localiz_master: name of the DB from which data is suppose to be copied.
jos_users: name of the table form the main DB.
localiz_master: user for the DB.
localhost: host
test_users: name of the table to be created.

we do have phpmyadmin but the user's table is hidden. can someone please tell us the SSH command we might run to make localiz_master user have access to all the databases.

thanks in advance.
ok..first you have to connect to you local database.
i have no idea what kind of permissions localiz_master has one thing is that you will need to use an admin user to assign this user the correct permissions.


you will need something like this,

first connect to myqsl server wherever it maybe.

Code:
mysql -h hostname -U user -ppassword
Code:
use mysql;

-------

Code:
GRANT CREATE VIEW  TO 'localiz_master'@'hostname' IDENTIFIED BY 'password';

flush privileges;



There may even be more privileges you need to assign....not sure...but if you do, you can assign them all in one go.
If that particular user cannot create views, im pretty sure there are alot of other things that the user cannot do.


Code:
select * from user where User='username';

setting any of these options from N to Y also enables this user access for this certain privilege.
 
Old 06-14-2010, 04:56 AM   #3
chetanmadaan
Member
 
Registered: Sep 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Here is was i got.


nexuasd@ip-173-201-26-125 [~]# su -
Password:
root@ip-173-201-26-125 [~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13987
Server version: 5.0.90-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL TO 'localiz_master'@'localhost' IDENTIFIED BY 'password';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'TO 'l
ocaliz_master'@'localhost' IDENTIFIED BY 'password'' at line 1
mysql>
 
Old 06-14-2010, 05:07 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by chetanmadaan View Post
Here is was i got.


nexuasd@ip-173-201-26-125 [~]# su -
Password:
root@ip-173-201-26-125 [~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13987
Server version: 5.0.90-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL TO 'localiz_master'@'localhost' IDENTIFIED BY 'password';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'TO 'l
ocaliz_master'@'localhost' IDENTIFIED BY 'password'' at line 1
mysql>


Code:
GRANT ALL ON *.* TO 'localiz_master'@'localhost' IDENTIFIED BY 'password';

If you are sure you want to give this user all these permissions
[/code]


*.* saying which databases to give the user permission on.
 
1 members found this post helpful.
Old 06-14-2010, 05:15 AM   #5
chetanmadaan
Member
 
Registered: Sep 2009
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks.

I love you!
 
Old 06-14-2010, 05:17 AM   #6
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
lol...ok use thread tools to mark this as solved...
 
Old 06-14-2010, 05:43 AM   #7
chetanmadaan
Member
 
Registered: Sep 2009
Posts: 30

Original Poster
Rep: Reputation: 15
did. thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permisions problem aaab Linux - General 6 01-23-2009 02:09 AM
permisions problem nnjond Linux - Newbie 18 03-08-2007 01:08 AM
Problem changing file permisions alaios Linux - General 8 01-25-2006 12:28 PM
howto chowto change file permisions in multiplhange file permisions in multiple dirs? pingvina Linux - Software 3 01-13-2006 03:10 PM
mysql permisions problem dvddecrypter Linux - Software 0 06-02-2004 08:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration