Joost van der Sluis wrote:
Thank you all for your patience. I installed the MYSQL LibraryOp maandag 01-12-2008 om 16:45 uur [tijdzone +1030], schreef Eric March:Tom Lisjac wrote:Hi Eric,I have followed source advice but can't connect. Can anyone help and/or is there a manual?Error: invalid compiler: file There must be something in my source looking for a compiler in the wrong place :-(The errors you're getting in the tutorial example are from some hard coded paths in the database_try.lpi project file. It's not a problem with your system. Since Lazarus has changed since the example was written, it might be easier to start your project with the sqldb components. To install sqldb, go to "Package->Open package file", select and install the lazarus/components/sqldb/sqldblaz.lpk package. After Lazarus recompiles, you should see a "SQLdb" tab. Drop a Mysql50 (TMySQL50Connection) on a new form. In the object inspector for this component, enter the hostname (probably localhost), a database (test or mysql as an example or a database you've already created) and the username and password for the database or the "root" you set when installing mysql. At this point, establishing a successful mysql connection is being able to set the Connected property to true without an error.Thanks heaps for the help. I Get this far and changing "Connected" to "True" gives the error "Cannot load MySQL library "libmysqlclient.so. Please check your installation."Maybe we have to improve that error-message even further. You have to install MySQL to be able to work with it. So install the mysql-client before you can use it. On linux it could be that you also have to install the '-dev' package. Joost _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus and now can set MySQL50Connection1 to true without an error. I tested it by entering an invalid database name in the properties (contact instead of contacts) and got an expected error. I then placed SQLTransaction1 and SQLQuery1 on the form. I presume I need to set the properties on SQLTransaction1 before I set properties on SQLQuery1. Soo, the situation is .... MySQL50Connection1 properties: CharSet = blank Connected = True DatabaseName = contacts Dialect = 0 Hostname = localhost KeepConnection = True LoginPrompt = False Name = MySQL50Connection1 Params = (TStrings) = empty Password = blank Role = blank Streamedconnected = True Tag = 0 *Transaction = blank UserName = root *I can change Transaction property to SQLTransaction1 but doesn't make any difference. SQLTransaction1 properties: Action = ""> Active = False (Won't change to true, but does not return any error when attempted) If I blank out the Database property and attempt Active = True get an error Database not assigned. Database = MySQL50Connection1 (The only drop down option as expected) Params = (TStringList) which is empty Tag = 0 I am guessing the SQLTransaction1 needs to be set to TRUE before I can set the SQLQuery1 properties. I get (and expected) an error on SQLQuery1. SQLQuery1 properties: Active = False "True" gives error = "Transaction of connection not set" (Expected) Database = MySQL50Connection1 DataSource = (blank) .. .. SQL = select * from people (A table in the contacts db) StatementType = stSelect Tag = 0 Transaction = SQLTransaction1 Also, MYSQL details below, in case it helps. mysql> \s -------------- mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (x86_64) using readline 5.2 Connection id: 98 Current database: contacts Current user: [EMAIL PROTECTED] SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.0.51a-3ubuntu5.3 (Ubuntu) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: latin1 Db characterset: latin1 Client characterset: latin1 Conn. characterset: latin1 UNIX socket: /var/run/mysqld/mysqld.sock Uptime: 2 days 38 min 8 sec Threads: 5 Questions: 10934 Slow queries: 0 Opens: 245 Flush tables: 1 Open tables: 64 Queries per second avg: 0.062 -------------- mysql> TIA Eric March |
_______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus