Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Johnny Need Help on February 12, 2004, 06:23:10 AM

Title: MySQL Remote Access
Post by: Johnny Need Help on February 12, 2004, 06:23:10 AM
I read an article that says in order to allow remote MySQL access you need to update these RPM's.  I have no idea how to access the internet from with the Mitel server or go about getting these updates.

I know where to find them on the internet and how to install them but I dont know how to get them on the SME box.  Is there a text based browser within SME?  or do I have to run it from the CDRom?

I am trying to access MySQL on the SME box from a remote computer.  I have setup a user and given him all permissions on the DB.  Everytime I try to connect I am getting a “Error No. 2013 Lost connection to MySQL server during query”.  I have tried SQLyog with no luck.



Thanks alot people.

J
Title: MySQL Remote Access
Post by: MasterSleepy on February 12, 2004, 06:29:13 AM
Hi,

To acces myqsl from your localnetwork try this
Code: [Select]

# /sbin/e-smith/db configuration setprop mysqld LocalNetworkingOnly no
# /sbin/e-smith/expand-template /etc/my.cnf
# /sbin/service mysqld restart


And SME have "lynx" to browse internet from command line.

Regards?
Title: MySQL Remote Access
Post by: Anonymous on February 12, 2004, 06:45:05 AM
Thanks MS,

I did try that and still no luck.
If it matters, I am trying to access the MySQL DB from a remote computer not on the local network.

But yes again, I did try what you mentioned and no luck.  I believe it has something to do with port 3306 and it not being open.

any ideas?

Thanks for your response.

J
Title: MySQL Remote Access
Post by: MasterSleepy on February 12, 2004, 09:53:07 AM
Maybe by opening that port, 3306, it will be good.
Title: did you try on localhost ?
Post by: chrsim on February 13, 2004, 12:02:04 PM
here are the single lines to use to check a mysql server + user rights wich I do on every install before I start dealing remotely with the server
1 go into a console, log as root
  - this is done with
   'ctrl+alt+F2, root login, root password'
2 get to / dir
  ' cd /' 8-)
3 start mysql
  'mysql' 8-)
  - there should not be any problem here, unless you changed the root password, but you didn't  :hammer: did you ?
4 see what's in your mysql.user table
  'use mysql;'  8-)
  'select * from user;' 8-)
if you are on a e-smith 5.6 or above, you should be on a 3.23 mysql version. Therefore, there are 17 fields in you table (host, user,password, + 14 rights columns)
5 create a new admin for remote purposes (I personnally create a new one for any new database I create)
'insert into user VALUES('%','ADMIN_Name',password('HIS_Password'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');' 8-)
6 check your new user rights and parameters
'select * from user;' 8-)
7 stop and restart you mysqld after exiting
'exit;' 8-)
'service mysqld stop' 8-)
'service, mysqld restart' 8-)
8 you should now be able to connect from anywhere, provided you do not use mysql-front from a windows station, wich doesn't work anymore on e-smith.
9 if you want to use phpMyadmin, put it in an ibay dedicated (mail me or ask the question here, or even check in the forum, this has been discussed many times in the past)

For explaination purpose, I have set this message with all command lines between '', and the  8-) smily stands for enter. please do not remove the '' in the insert statement. Hope I have been clear enough.

 :pint:
Title: Re: did you try on localhost ?
Post by: grand-pa on February 13, 2004, 04:46:12 PM
Quote from: "chrsim"
'insert into user VALUES('%','ADMIN_Name',password('HIS_Password'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');' 8-)
6 check your new user rights and parameters
'select * from user;' 8-)
7 stop and restart you mysqld after exiting
'exit;' 8-)
'service mysqld stop' 8-)
'service, mysqld restart' 8-)

Sorry, but that way of doing is so awfull, i have to show a better way... :hammer:

In the mysql client, to create a database administrator you just have to type :
Code: [Select]
mysql> GRANT ALL PRIVILEGES ON *.* TO 'your_new_dba'@'%' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> QUIT;

There is no need to restart the mysql daemon.
You juste have to change your_new_dba and your_password with your own values.

Note: to restrict access to the mysql server, you can specify an IP (range of) address.
You just have to modify '%' to something like '123.123.123.0/255.255.255.0' ;-)

If you want just to create a limited local mysql user, you can type :
Code: [Select]
mysql> GRANT SELECT, UPDATE, INSERT, DELETE ON specified_database.* TO 'new_local_user'@'localhost' IDENTIFIED BY 'its_mysql_password';
mysql> FLUSH PRIVILEGES;
mysql> QUIT;

That kind of mysql user is very useful to access and modify the datas of a specified_database in a PHP script. ;-)

For other options, have a look at the MySQL documents. :-P
Title: So sorry ...
Post by: chrsim on February 14, 2004, 04:31:33 PM
:-( I have to take my responsabilities over the
consequences of the above post, and shall now
Quote
retire from trying to teach before I learned
;-)
Les français apprécieront