Page 2 of 3

Re: MYSQL

Posted: Wed Dec 12, 2012 1:44 pm
by mol
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

Re: MYSQL

Posted: Wed Dec 12, 2012 2:07 pm
by bpd2000
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

Re: MYSQL

Posted: Wed Dec 12, 2012 2:20 pm
by charlesg
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.

Re: MYSQL

Posted: Wed Dec 12, 2012 4:06 pm
by Rathinagiri
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.

Re: MYSQL

Posted: Wed Dec 12, 2012 4:56 pm
by t57042
There is no other user to check, just 2 machines.
How can I modify?
In what should I change 'root' on the client?

Richard

Re: MYSQL

Posted: Wed Dec 12, 2012 5:16 pm
by Rathinagiri
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.

Re: MYSQL

Posted: Wed Dec 12, 2012 6:36 pm
by t57042
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

Re: MYSQL

Posted: Wed Dec 12, 2012 7:34 pm
by mol
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!

Re: MYSQL

Posted: Thu Dec 13, 2012 12:43 am
by Rathinagiri
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.

Re: MYSQL

Posted: Thu Dec 13, 2012 6:29 am
by mol
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