MYSQL

Moderator: Rathinagiri

User avatar
mol
Posts: 2878
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 135 times
Been thanked: 69 times
Contact:

Re: MYSQL

Post by mol » Wed Dec 12, 2012 1:44 pm

It's strange, but, I can connect to the same computer by localhost, but I can't connect vy IP address or real name of computer...

look at the picture:
Image

User avatar
bpd2000
Posts: 963
Joined: Sat Sep 10, 2011 4:07 am
Location: India
Has thanked: 133 times
Been thanked: 43 times

Post by bpd2000 » Wed Dec 12, 2012 2:07 pm

Try after adding IP Address / Computer name in Host files
----------
Try to locate any existing hosts file on your computer:
Windows 95/98/Me c:\windows\hosts
Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
Windows XP Home c:\windows\system32\drivers\etc\hosts
(you may need administrator access for Windows NT/2000/XP)
----------
Open your hosts file in Notepad. It should look something like this when you open it:
# Copyright (c) 1998 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP stack for Windows98
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:

# 102.54.94.97 rhino.acme.com # source server

# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
BPD
Convert Dream into Reality through HMG

charlesg
Posts: 4
Joined: Sat Oct 30, 2010 9:52 am

Post by charlesg » Wed Dec 12, 2012 2:20 pm

Hi

All I can tell you is my experience of using mySQL on Linux.

You have to tell mySQL host to allow remote access by doing at least all of the following:
1 comment out skip-networking in [[/etc/mysql/my.cnf]]
2 comment out bind address in [[/etc/mysql/my.cnf]]
3 allow remote connection from your lan subnet 192.168.1.0/24:
sudo /sbin/iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp --destination-port 3306 -j ACCEPT
5 In mySQL: grant all privileges on DatabaseName.* to [[LoginName@'192.168.1.74'|LoginName@'192.168.2.3' ]] identified by 'password';
where 1.74 to 2.3 is the possible range.

at least some of that must apply under windows.

User avatar
Rathinagiri
Posts: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Wed Dec 12, 2012 4:06 pm

Marek and Richard,

I think I have found out the problem! For your problem the solution is very simple.

MySQL server is set by default not to connect 'root' user from other than localhost! That is for security reasons. But this can be modified also.

Please check with another user.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Wed Dec 12, 2012 4:56 pm

There is no other user to check, just 2 machines.
How can I modify?
In what should I change 'root' on the client?

Richard

User avatar
Rathinagiri
Posts: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Wed Dec 12, 2012 5:16 pm

Kindly read this:

http://www.howtogeek.com/howto/programm ... -any-host/

You can create any number of user accounts in MySQL server for remote access, since root access from remote host is not secure.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Wed Dec 12, 2012 6:36 pm

Thank you very much - you are the best :D
I even reinstalled my windows firewall - and it works OK.

2 more things:

1. This is my first contact with MySQL ( I already used SQLite, but not with HMG).
I still would prefer a server/client solution using native XBASE commands like Letodb.
But still waiting a solution to link the library (see topic LETODB).
Maybe in the long run MySQL is better?

2. Is there an 'easy way' to convert XBASE-like programs to MySQL syntax (functions...)?

Thanks again

Richard

User avatar
mol
Posts: 2878
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 135 times
Been thanked: 69 times
Contact:

Post by mol » Wed Dec 12, 2012 7:34 pm

You are great Rathi!

That was really problem with root user!

I've read about it few years ago, but I've missed it...


Many thanks!

User avatar
Rathinagiri
Posts: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Thu Dec 13, 2012 12:43 am

t57042 wrote:Thank you very much - you are the best :D
I even reinstalled my windows firewall - and it works OK.

2 more things:

1. This is my first contact with MySQL ( I already used SQLite, but not with HMG).
I still would prefer a server/client solution using native XBASE commands like Letodb.
But still waiting a solution to link the library (see topic LETODB).
Maybe in the long run MySQL is better?

2. Is there an 'easy way' to convert XBASE-like programs to MySQL syntax (functions...)?

Thanks again

Richard
In SQL arena, for single user system SQLite is the best and for multi-user system we have many products like MySQL, MariaDB, PostgreSQL, FireBird etc.,

I am using SQLite and MySQL extensively and exclusively in almost all my new projects. Some old projects are still running in dbf too.

IMHO it is not that hard to converge from dbf to sql.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
mol
Posts: 2878
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 135 times
Been thanked: 69 times
Contact:

Post by mol » Thu Dec 13, 2012 6:29 am

Maybe it's not good place, but I want to point onee problem with sqlite.
function SQL was defined with these statements:

Code: Select all

stmt := sqlite3_prepare(dbo1,qstr)

	IF ! Empty( stmt )
	   for i := 1 to sqlite3_column_count( stmt )
		  type1 := upper(alltrim(sqlite3_column_decltype( stmt,i)))
		  do case
			 case type1 == "INTEGER" .or. type1 == "REAL" .or. type1 == "FLOAT" .or. type1 == "DOUBLE"
				aadd(typesarr,"N")
			 case type1 == "DATE" .or. type1 == "DATETIME"
				aadd(typesarr,"D")
			 case type1 == "BOOL"
				aadd(typesarr,"L")
			 otherwise
				aadd(typesarr,"C")
		  endcase
	   next i
	endif
	SQLITE3_FINALIZE( stmt )
When I declared one column as INTEGER(3)

SQL function converted numeric data to strings!!!

I was looking for problem, and solution appears so simple:

Code: Select all

 do case
			 case type1 = "INTEGER" .or. type1 = "REAL" .or. type1 = "FLOAT" .or. type1 = "DOUBLE"
				aadd(typesarr,"N")
problem with ==

Regards, Marek

Post Reply