Le 26/09/12 12:46, Ian Whitfield a écrit : Hi Ian,
> Hi All - Can anyone help me out please!!?? > I'm beginning to believe that you are jinxed when it comes to db problems ;-) > I want to transfer my Database from the embedded DB to a MySQL DB. I'm > using PCLinuxOS 2012 and AOO 3.4.0. > > * I Created a new empty SQL DB on my WebServer, with all my fields, > using phpMySQLAdmin. > * I exported this DB back to my home computer. It comes out as a > 'filename.sql' and seems to be a text document. (If I "open" this > file it opens in my HTML Editor!!) As others have said, this is of absolutely no use to you in order to setup a JDBC connection to your local mysql server from within AOO. > * I downloaded and extracted 'mysql-connector-java-5.1.22.tar.gz'. > After extraction I have 'mysql-connector-java-5.1.22-bin.jar' in a > folder '/home/ian/Database'. What are the read/write permissions on that folder ? Now, start up AOO, go to Tools>Options Under Java, wait for AOO to recognise your version of Java, then click on the "Classpath" button followed by "Add an archive". Navigate to your /home/ian/Database folder and double-click on the jar file. Click on OK and OK again, to come back to the general Java configuration screen of AOO. If you get an error at any stage of the above selection/validation of the Jar archive, then you have something wrong with either : - your permissions on the folder ; - your version of Java or the version of the jar file (although the latter is less likely). One way around the potential permissions problem is to copy the jar file to the "Ext" or "Extensions" directory of your Java installation. Usually, this is something like /usr/share/java or /usr/local/java, depending on the Linux distro you are using. You will need to copy the file as sudo or root. If you get an error message when trying to add the archive, please tell us what it is, exactly. > * I start Base and select 'Connect to existing DB' - JDBC > * Under Datasource I select the above 'Filename.sql' file. Select MySQL from the dropdown list instead of JDBC. Then in the next wizard screen, select "use JDBC (Java Database connectivity)". Under datasource, please enter the exact name of the database as you created it on your webserver. So, if the name of the db you created with phpmyadmin is called "test", enter "test" as the datasource name. Enter 127.0.0.1 as the server The default port for most Linux distributions running a mysql server is 3306, so you shouldn't need to change this. > * Under JDBC Class I select > '/home/ian/Database/mysql-connector-java-5.1.22-bin.jar' > * I select 'Test Class' and get the error "The JDBC Driver could not > be loaded". Using the MySQL connection choice as indicated above, the driver string is preloaded for you : com.mysql.jdbc.Driver You can test whether the driver is loaded properly by AOO by clicking on the "Test class" button. Clicking on "Next" will take you to the next screen of the wizard where it will ask you for a user name authorised to connect to the database. Depending on whether or not you have previously added yourself as a user to the mysql server, you will have a choice of : - your user name, if you have created a user account with the mysql server, or one was created for you when you installed the server on your machine ; - root ; - phpmyadmin ; - pma (possibly, if you have the PMA extension installed for phpmyadmin); - possibly another admin user, that goes by various names depending on your distro (db-maintainer, dbconf-maintainer, or something like that). If you require a password to connect as any of those users, then tick the checkbox and then try to connect by clicking the "Connect" button. On some Linux installations, no password is set by default for the root user. If this is the case with your mysql server, it is potentially a major security flaw that you should correct as soon as possible through the administration utilities for that server (command line, or MySQL Control Center if you prefer a graphical interface) Things to look out for : Empty DateTime strings, i.e. null dates, represented as "0000-00-00", are not supported by the JDBC connector and cause an error to be thrown, which can lead to a crash in AOO when you browse tables in the tree hierarchy view ; AOO has a really annoying behaviour, at least on Mac OSX, of toggling a table representation (i.e. when you double click on a table in the list of tables from the main ODB window), to put it behind the main Base ODB container window, forcing the user to go and find that window with the mouse to bring it to the foreground focus. If you are in full screen mode with your main Base ODB container, it looks like the window just appears then disappears almost instantaneously. This was also a bug in LO for a while, but which has since been fixed - good job too, because it drove me nuts ! Browsing Tables in the DataSourceBrowser (AOO F4 or corresponding toggle icon) whilst descending the hierarchical tree view from a table with more columns to a table with fewer columns will cause AOO to crash; JDBC performance is worse than with the native C++ connector driver, especially with large result sets or multiple join queries - there is no rememdy for that, I'm afraid - these performance issues are less/greater depending on the version of Java you have installed on your machine and recognised by AOO - even with a "good" Java version connecting to a locally hosted mysql server, performance is noticeably slower, e.g. scrolling operations, screen refreshing, queries, etc ; Certain features that are available in MySQL, are not supported over the JDBC connector and will lead to a table representation of <OBJECT>, with nothing visible for you to look at instead of your data. These <objects> are usually, but not exclusively, binary objects. In AOO, there is currently no support in the AOO code for CLOB objects other than images, and images aren't supported by the JDBC driver, only the native Connector C++ driver. Alex --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
