Mysql++ on Mac

My code, which works fine in Linux (Ubuntu 10.10) looks like this:
Connection conn(false);
conn.connect(db, server, user, pass)
Transaction trans(conn);
Query query = conn.query("Update blah blah");
query.execute(); // inside try,catch,catch block
query << "Another update";
query.execute(); //try
query << "Yet another";
query.execute; //try
trans.commit();
query << "select this, that and the other thing";
vector<deepskyStruct> resvec; // deepskyStruct is an ssqls structure
query.storein(resvec);
vector<deepskyStruct>::iterator it;
for loop through the vector, creating members of class SessionObject from the data
end for
start another transaction
query << "Update a different table";
query.execute(); //two more of these
trans2.commit();
query << "Select blah, blah blah from a different table";
vector(doubleStarStruct> resvec2;
//Up to here, everything is fine, and I have verified that all the updates took place. I also know that the first select, storing in resvec, creating the objects, etc. worked, because when I commented out the stuff for the 2nd table the program completed successfully with the expected output.
query.storein(resvec2);
Then:
402 query.storein(resvec2);
(gdb) next
Program received signal EXCBADACCESS, Could not access memory.
Reason: KERNPROTECTIONFAILURE at address: 0x0000041c
0x93d12a8d in std::string::clear ()
The address of resvec2 was 0xbfffefdc, while the address of resvec was 0xbfffefb0 or sth in that neighborhood.
Any help appreciated.
Thanks,
Alan Shank
Woodland, CA

I have gathered some more information after debugging the program in XCode.
vector<deepSkyStruct> resvec; // deepSkyStruct is an ssqls structure
Here is the calling sequence:
query.storein(resvec); // this is in mycode
storein(Container & con); // in the Mysql++ library
storein(con, str(template_defaults) );
storein_sequence(con, s); // s is a const SQLTypeAdapter
UseQueryResult result = use(s);
while(1) {MYSQL_ROW d = result.fetchrawrow();
the UseQueryResult object result has a private member result_ with these members:
counted_
refs_
The first time I call query.storein(resvec), after use(s), the result object has these values:
counted_ = 0x5016f0
refs = 0x501cd0
The code works fine.
When, after another query to a different table, I call query.storein(resvec2), after the use(s), the members counted_ and refs_ are both 0x0. Then, when result.fetchrawrow is called, the program gets the EXCBADACCESS error. The debugger window shows this:
0x98d17a7c <+0000> push ebp
0x98d17a7d <+0001> mov ebp,esp
0x98d17a7f <+0003> sub esp,0x18
0x98d17a82 <+0006> mov eax,DWORD PTR [ebp+0x8]
0x98d17a85 <+0009> mov DWORD PTR [esp+0xc],0x0
0x98d17a8d <+0017> mov edx,DWORD PTR [eax]
the last line is highlighted and a red arrow points to it.
I have also posted this question on MYSQL Forums, with no response except a troll.
Cheers,
Alan Shank
Woodland, CA

Similar Messages

  • How to Install DBD::mysql on Mac OSX 10.4.7 SERVER Universal

    I spent 3 days trying to figure out how to install DBD::mysql on OSX 10.4.7 Server Universal on my Mac Pro.
    I didn't think it would be so hard just to get it installed so I could use Movable Type. Yikes!
    Anyway, I wrote up a tutorial on what I did to get it installed. Hopefully it will help you out if you are having problems installing DBD::mysql on Server 10.4.7 Universal with a Mac Pro.
    DISCLAIMER: I cannot say whether or not this will work with any other version of Server or Macintosh. Inside the article below is a link to how to install DBD::mysql on other versions of OSX that may or may not work for you.
    http://macnewsblog.com/2006/09/howto_install_dbdmysql_onmac.html
    MacBook Pro 15" Mac OS X (10.4.6)

    Hopefully this worked for those with Mac Pros!

  • Configuring MySQL on Mac OS 10.4.5

    I recently downloaded MySQL Version 5.0.20a-max via socket (Server) 5.0.18 (Client Version) on my Mac. Everything seemed to install just fine. I even have the MySQL server in my preferences and it always seems to be running. I am using the MySQL admimistrator and I can connect with the host set at: localhost - but when I pop in a user name and password - I get access denied. So, I just log in with my login name without a password and I gain access at least to the admin window.
    However, when I try and create a new database using YourSQL - I'm denied access to everything but the MySQL test database.
    I've tried to set up a root account early on in the UNIX terminal, but I must have fouled something up, because every command I try and use from every help article I've read I'm still denied access - I've even tried to run an uninstall of the MySQL installation and I keep getting the no such directory exists.
    How can I remove this app and start over - or can I somehow get in the admin and reset my password.
    Everything seems to work up to a point. It's like seeing the light at the end of the tunnel, but I'm denied access to anything new I would like to create.
    If you require a step by step process to see where I may have gone wrong, I'd be more than happy to supply it...
    Thanks...

    On the server in the terminal set the root password by typing:
    mysqldadmin -h localhost -u root password "rootpassword"
    where rootpassword is the password you want to set.
    Next connect to mysql as root:
    mysql -p -u root
    then create the new database
    mysql> create database databasename;
    where databasename is what you want to call it (don't forget the closing semicolon).
    then
    mysql> grant all on databasename.* to 'username'@'yourclientIPaddress' identified by 'yourpassword';.
    This last command will give access to all operations on this new database to your username at the ip address of your client machine. Yourpassword = the password you want to use for your mysql connection, not the root password.

  • Installing and running mySQL on Mac OS 10.4

    I'm hoping someone here might be able to point me in the
    right direction. I've installed mySQL, and in Terminal got so far
    as getting the response "Starting MySQL database server", but then
    it just goes to a "/usr/local/mysql Bob$" prompt, and nothing else
    happens. Did it launch? I've been told I need to use a script via
    the command line mysql utility, but can't seem to find where that
    is.
    When I search for help on the Web, I find many, many articles
    for advanced users, but nothing that gives a step-by-step
    walkthrough to someone just trying to install mySQL successfully on
    Mac 10.4 and make it work with CF. Is Mac making this such an
    endeavor? Thanks.

    Does anyone know of a good telephone support firm that could
    help me get everything working, including mySQL? Might be worth it.
    Thanks

  • Php/mysql problems Mac OS 10.4

    After upgrading to Mac 10.4 from 10.3, I get this message on
    my dynamic
    pages
    Can't connect to local MySQL server through socket
    '/var/mysql/mysql.sock' (2)
    I can connect to both the local and remote mysql server from
    the terminal.
    As far as I can tell there is no directory named "mysql", so
    "Hard Drive:var:mysql" mysql doesn't exist.
    php works fine, but I also get a warning:
    Warning: mysql_connect() [function.mysql-connect]: Protocol
    mismatch;
    server version = 9, client version = 10
    Connected successfully
    I've googled all over, I'm stumped.
    Mick

    David Powers wrote:
    > Mick White wrote:
    >
    >> After upgrading to Mac 10.4 from 10.3, I get this
    message on my
    >> dynamic pages
    >> Can't connect to local MySQL server through socket
    >> '/var/mysql/mysql.sock' (2)
    >
    >
    > Try this in Terminal:
    >
    > ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
    >
    Thanks David, this is what I did along the same lines:
    sudo mkdir /var/mysql
    sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock
    http://forum.mamboserver.com/showthread.php?t=70766
    Mick

  • Upgrade mysql in Mac Os Server Snow Leopard 10.6.8

    Hi
    The built in mysql server on Mac Os Server Snow Leopard 10.6.8 that I have bought is 5.0, I need to upgrade it to 5.5, how do I do that?
    I followed these instructions
    http://support.apple.com/kb/HT4006
    Everything went smoothly except that the server is not upgraded still the same version.
    Thanks

    Chris is right. The only way, you can upgrade to 5.5 is by doing it manually. Apple will probably update to a later version with Lion. But MySQL version updates have been rare in the past.
    Installing a different version is pretty straightforward, but you can not use SA anymore and have to configure the php, apache in the correct way. There are plenty of links out there which can help you.
    So long.
    Lane

  • MySQL and Mac

    I came across this article because I am trying to set up a database using MySQL. It explains how to set it up on your Mac but mentions "When installing MySQL, you need to be aware of the potential effect this will have on the security of your system, as a database server can open an avenue of attack." What kind on attacks are they talking about? I am a complete beginner to this and the method for optimal security installation doesn't make any sense.
    http://developer.apple.com/internet/opensource/osdb.html

    There are several different levels of security that are possible with MySQL. Depending on your installation, you may not need to worry about all of them.
    If you did a default installation, with no firewall running, anyone on your local subnet could connect to your MySQL. If you are behind a NAT router (such as a Wifi router), that will be very few people. If you were directly connected to the Internet (very unusual) that would be everyone. If you don't want anyone else to connect to your MySQL, it would be best to make sure the firewall is running and that the MySQL port isn't open. (By default, most firewalls are designed to allow access to server software like MySQL. Otherwise, the server software wouldn't work! Running MySQL for your own purposes is a special case where you do want a firewall and you don't want ports open).
    On another level, you can configure MySQL to handle its own security. Usually, user accounts in MySQL are configure to only allow connections from "localhost". This is a very good idea. Then, only local users, such as your self can connect. There is still a slight chance of potential vulnerability from unknown and unpatched security bugs in MySQL itself. A firewall would protect you from that infinitesimally small risk.
    Finally, many people like to use the phpMyAdmin web-based admin tool. That is what most web hosting providers use so it is good to know how to use it. And it is very handy. The problem is that the firewall will allow port 80 access by default and that would give people access to your admin tool. It would be best to set the firewall to "allow only essential services". If you do want to open the web server port, make sure you have a localhost-only MySQL user account and make sure the password is good and maybe even put an htaccess file in the phpMyAdmin folder to further restrict access in any number of ways.
    I think I've covered it all! Let me know if I've missed anything.

  • Mysql connection mac-server 2003

    Hi there,
    Recently I bought my first Mac(book). I'm running MySQL on a local server
    and with my PC I can connect without a problem to localhost in the MySQL
    Connection box.
    On my Mac I can't get this done. Tried several things like the IP adress,
    servername etc. and am realy stuck. Anybody here has a solution?
    Greetings,
    Henk

    Not many of us have 2003, so pardon if our answers miss the mark...
    OS X tries to use your OS X username/password, so do you have an account set up on 2003 with that username?
    You do know that you will need a different driver for network printing to the Deskjet? The HP-provided driver (including pre-installed on OS X) is written to use USB only.
    Get hpijs and ESP ghostscript from:
    http://www.linuxprinting.org/macosx/hpijs/

  • Trouble connecting to MySQL on Mac mini server

    Trying to connect to the MySQL server from a remote client. I have "allow network connections" checked, and a password set. When I try to connect from an admin computer, I am told
    "Host 'macbookpro.domain.tld' is not allowed to connect to this MySQL server"
    The Server setup guide doesn't give much information for MySQL, besides how to turn it on.
    What am I missing?

    I finally found out how to do this using the application Sequel Pro recommended by MrHoffman.
    The steps are basically.
    1. Start MySQL
    2. Install Sequal Pro on the server
    3. Launch Sequel Pro and connect
    4. From the Choose Database… pop-up, choose mysql
    5. Select user in the left sidebar and Content from the Toolbar
    6. Select the root user in this table and click the duplicate button below the table (looks like 2 plus signs)
    7. Change the "host" field to be something like 192.168.1.%, where the first three octets are the same as your local network. The % is a wild card that allows a connection from any client on the mentioned network.
    8. Stop the MySQL service.
    9. Start the MySQL service.
    10. Install Sequel Pro on your client system and connect.

  • PHP/MySQL on Mac

    I'm just learning PHP and I can't even get a simple HTML form to work with PHP, even though I have register_globals turned on. How can I fix this?
    Dual-2GHz PowerMac G5   Mac OS X (10.4.5)  

    form.php:
    <html>
    <head><title>Test Page</title></head>
    <body>
    Data Collection
    <form action="action.php" method="get">
    <table>
    <tr><td>Name:</td><td><input type="text" name="Name" /></td></tr>
    <tr><td>Age:</td><td><input type="text" name="Age" /></td></tr>
    <tr><td colspan="2" align="center"><input type="submit" /></td></tr>
    </table>
    </form>
    </body>
    </html>
    action.php:
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <?php
    print "Your name is ". $Name;
    print "<br />";
    print "You are ". $Age . " years old";
    print "<br />";
    $old = 25 + $Age;
    print "In 25 years you will be " . $old . " years old";
    ?>
    </body>
    </html>
    1.83GHz MacBook Pro (home), Dual-2GHz PowerMac (work)   Mac OS X (10.4.6)  

  • Mysql on mac os x

    mysql is free ware to use & free to download it help? please?

    Yes. MySQL has a free community version that is free to use and download.
    http://dev.mysql.com/downloads/

  • Can't start mysql 5.5 on MAC OS X server

    attempting to start MySQL on Mac OS X server 10.6 fails with following error:
    [ERROR] /usr/local/mysql-5.5.8-osx10.6-x86_64/bin/mysqld: unknown option '--skip-locking'
    appreciate any advice or help how to fix this problem.
    thank you.

    I had the same problem when upgrading from MySQL 5.1 to 5.5.
    The skip-locking construct was removed in mysql 5.5:
    http://dev.mysql.com/doc/refman/5.5/en/mysql-nutshell.html
    Search for skip-locking...
    I fixed this by editing /etc/my.cnf. Under [mysqld], change "skip-locking" to "skip-external-locking".
    It might be worth your while to grab a new my.cnf from /usr/local/mysql/support-files. There are several default configuration options to choose from. I'm still running my customized version from 5.1, but I'm guessing there are changes that I haven't encountered yet.
    Good luck.

  • Mysql Mac Mountain Lyon

    I have problems to reinstall MySQL on Mac OS X after it was running on my system.
    I uninstalled it because the PreferencePane wasn't working as expected, using the procedure described here: http://akrabat.com/computing/uninstalling-mysql-on-mac-os-x-leopard/
    When trying to reinstall MySQL Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive version using the PKG-installer, it says "The installation failed"
    Here are the complete logs of the installation:
    I will really appreciate any help
    >
    >    Sep  7 15:12:02 Mariana.local Installer[18449]: @(#)PROGRAM:Install  PROJECT:Install-729
    >Sep  7 15:12:02 Mariana.local Installer[18449]: @(#)PROGRAM:Installer  PROJECT:Installer-614
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Hardware: MacBookAir5,2 @ 1.80 GHz (x 4), >4096 MB RAM
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Running OS Build: Mac OS X 10.8.1 (12B19)
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: PATH=/usr/bin:/bin:/usr/sbin:/sbin
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: >TMPDIR=/var/folders/b7/061c4tk55tv6vqb3_0lstswm0000gn/T/
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: SHELL=/bin/bash
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: HOME=/Users/Mayoli
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: USER=Mayoli
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: LOGNAME=Mayoli
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: SSH_AUTH_SOCK=/tmp/launch->9XSV4t/Listeners
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: Apple_Ubiquity_Message=/tmp/launch->xvAqrI/Apple_Ubiquity_Message
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: Apple_PubSub_Socket_Render=/tmp/launch->bwx8YE/Render
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: COMMAND_MODE=unix2003
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Env: __CF_USER_TEXT_ENCODING=0x1F5:0:0
    >Sep  7 15:12:02 Mariana.local Installer[18449]: MySQL Startup Item  Installation Log
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Opened from: /Volumes/mysql-5.5.27-osx10.6->x86_64/MySQLStartupItem.pkg
    >Sep  7 15:12:02 Mariana.local Installer[18449]: fileURLForURL = x-disc://mysql-5.5.27->osx10.6-x86_64/MySQLStartupItem.pkg
    >Sep  7 15:12:02 Mariana.local Installer[18449]: fileURLForURL = >file://localhost/Volumes/mysql-5.5.27-osx10.6-x86_64/MySQLStartupItem.pkg
    >Sep  7 15:12:02 Mariana.local Installer[18449]: Referenced component packages (1) >trustLevel=100
    >Sep  7 15:12:04 Mariana.local Installer[18449]: InstallerStatusNotifications plugin loaded
    >Sep  7 15:12:10 Mariana.local installd[509]: installd: Exiting.
    >Sep  7 15:12:10 Mariana.local runner[18509]: Administrator authorization granted.
    >Sep  7 15:12:10 Mariana.local Installer[18449]: >============================================================================== ==
    >Sep  7 15:12:10 Mariana.local Installer[18449]: User picked Standard Install
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Choices selected for installation:
    >Sep  7 15:12:10 Mariana.local Installer[18449]:           Install: "MySQL Startup Item"
    >Sep  7 15:12:10 Mariana.local Installer[18449]:                     MySQLStartupItem.pkg : >com.mysql.mysqlstartup : 1.0.0.1.0
    >Sep  7 15:12:10 Mariana.local Installer[18449]: >============================================================================== ==
    >Sep  7 15:12:10 Mariana.local Installer[18449]: It took 0.00 seconds to summarize the package >selections.
    >Sep  7 15:12:10 Mariana.local Installer[18449]: -[IFPKGDerivedDocument >sortedPackageLocations]: result = (
    >              "file://localhost"
    >          )
    >Sep  7 15:12:10 Mariana.local Installer[18449]: -[IFDInstallController(Private) >_buildInstallPlan]: location = file://localhost
    >Sep  7 15:12:10 Mariana.local Installer[18449]: -[IFDInstallController(Private) >_buildInstallPlan]: file://localhost/Volumes/mysql-5.5.27-osx10.6-x86_64/MySQLStartupItem.pkg
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Set authorization level to root for session
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Will use PK session
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Starting installation:
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Configuring volume "Macintosh HD"
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Preparing disk for local booted install.
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Free space on "Macintosh HD": 74.42 GB >>>>>>>(74416689152 bytes).
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Create temporary directory >"/var/folders/b7/061c4tk55tv6vqb3_0lstswm0000gn/T//Install.18449AgPXBh"
    >Sep  7 15:12:10 Mariana.local Installer[18449]: IFPKInstallElement (1 packages)
    >Sep  7 15:12:10 Mariana.local Installer[18449]: Using authorization level of root for >IFPKInstallElement
    >Sep  7 15:12:10 Mariana.local installd[18515]: installd: Starting
    >Sep  7 15:12:10 Mariana.local installd[18515]: installd: uid=0, euid=0
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: ----- Begin install -----
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: request=PKInstallRequest <1 >packages, destination=/>
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: packages=(
              >    "PKJaguarPackage <file://localhost/Volumes/mysql-5.5.27-osx10.6->x86_64/MySQLStartupItem.pkg>"
    >          )
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: Extracting >file://localhost/Volumes/mysql-5.5.27-osx10.6-x86_64/MySQLStartupItem.pkg >>>>>>>>>>(destination=/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup At >Startup/PKInstallSandboxManager/1.sandbox/Root/Library/StartupItems, uid=0)
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: prevent user idle system sleep
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: suspending backupd
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: Shoving >/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup At >Startup/PKInstallSandboxManager/1.sandbox/Root (1 items) to /
    >Sep  7 15:12:10 Mariana.local install_monitor[18520]: Temporarily excluding: /Applications, >/Library, /System, /bin, /private, /sbin, /usr
    >Sep  7 15:12:10 Mariana.local installd[18515]: PackageKit: Executing script "./postinstall" >in /Volumes/mysql-5.5.27-osx10.6-x86_64/MySQLStartupItem.pkg/Contents/Resources
    >Sep  7 15:12:10 Mariana.local install_monitor[18520]: Re-included: /Applications, /Library, >/System, /bin, /private, /sbin, /usr
    >Sep  7 15:12:11 Mariana.local installd[18515]: PackageKit: releasing backupd
    >Sep  7 15:12:11 Mariana.local installd[18515]: PackageKit: allow user idle system sleep
    >Sep  7 15:12:11 Mariana.local installd[18515]: PackageKit: Install Failed: Error >Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the >package “MySQLStartupItem.pkg”." UserInfo=0x7fb809c201f0 {NSFilePath=./postinstall, >NSURL=file://localhost/Volumes/mysql-5.5.27-osx10.6-x86_64/MySQLStartupItem.pk g, >PKInstallPackageIdentifier=com.mysql.mysqlstartup, NSLocalizedDescription=An error occurred >while running scripts from the package “MySQLStartupItem.pkg”.} {
    >              NSFilePath = "./postinstall";
    >?              NSLocalizedDescription = "An error occurred while running scripts from the package >\U201cMySQLStartupItem.pkg\U201d.";
    >              NSURL = "file://localhost/Volumes/mysql-5.5.27-osx10.6->x86_64/MySQLStartupItem.pkg";
    >              PKInstallPackageIdentifier = "com.mysql.mysqlstartup";
    >          }
    >Sep  7 15:12:11 Mariana.local Installer[18449]: install:didFailWithError:Error >Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the >package “MySQLStartupItem.pkg”." UserInfo=0x7f82d14a84c0 {NSFilePath=./postinstall, >NSURL=file://localhost/Volumes/mysql-5.5.27-osx10.6-x86_64/MySQLStartupItem.pk g, >PKInstallPackageIdentifier=com.mysql.mysqlstartup, NSLocalizedDescription=An error occurred >while running scripts from the package “MySQLStartupItem.pkg”.}
    >Sep  7 15:12:11 Mariana.local Installer[18449]: Install failed: The Installer encountered an >error that caused the installation to fail. Contact the software manufacturer for assistance.
    >Sep  7 15:12:11 Mariana.local Installer[18449]: IFDInstallController D0434500 state = 7
    >Sep  7 15:12:11 Mariana.local Installer[18449]: Displaying 'Install Failed' UI.
    >Sep  7 15:12:11 Mariana.local Installer[18449]: 'Install Failed' UI displayed message:'The >Installer encountered an error that caused the installation to fail. Contact the software >manufacturer for assistance.'.

    Don't install the startup item package. Those things were deprecated years ago.
    Follow the instructions in this User Tip: https://discussions.apple.com/docs/DOC-3082

  • Mac OS X MySQL Connect throws Unexpected end of input stream

    With java version 1.4.2_05 I'm attempting to run an application which retrieves information from a MySQL database version 4.1 on Mac OS X Panther 10.3.6 The application operates without error on Windows and Linux using MySQL v4.0. Relevant Code appears below..
              private static final String DRIVER = "com.mysql.jdbc.Driver";
         private static final String URL = "jdbc:mysql://localhost:3306";
         boolean openConnection() throws SQLException, DatabaseException {
              try {
                   if (con == null) {
                        StringBuffer sb = new StringBuffer(URL);
                        sb.append("/").append(getDatabase());
                        Class.forName(DRIVER);
                        /* Failure occurs here while calling getConnection on the
                        DriverManager class. */
                        con = DriverManager.getConnection(sb.toString(), getUser(), getPassword());
              } catch(SQLException sle) {
                   sle.printStackTrace();
         } But on Mac X I'm seeing an exception thrown.
    java.sql.SQLException: Communication link failure: java.io.IOException, underlying cause:
    Unexpected end of input stream
    ** BEGIN NESTED EXCEPTION **
    java.io.IOException
    MESSAGE: Unexpected end of input stream
    STACKTRACE:
    java.io.IOException: Unexpected end of input stream
            at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1096)
            at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:626)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562)
            at com.mysql.jdbc.Connection.<init>(Connection.java:491)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
            at java.sql.DriverManager.getConnection(DriverManager.java:512)
            at java.sql.DriverManager.getConnection(DriverManager.java:171)I have checked to see that the proper permissions are established in the database. I've used the GRANT statement etc. It's unclear to me why I am having difficulty with the newer MySQL on Mac OS X. Any feedback is appreciated thanks.

    I managed to solve this by having the MySQL server run as a service rather than attempting to start it via the application. So now the application can retrieve from the database without error.

  • Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

    I'm using the pre-installed versions of php and mysql under Mac OS X Server 10.4.4 running on a G4 and am unable to get anything involving mysql to work.
    I ssh to the server and enter various commands in Terminal:
    on typing "mysql" I get
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
    and on typing "mysqladmin version" I get
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!
    On typing "sudo mysqld_safe" I get
    Starting mysqld daemon with databases from /var/mysql
    STOPPING server from pid file /var/mysql/MyServer.local.pid
    070722 16:06:05 mysqld ended
    /var/mysql/MyServer.local.err contains
    070722 16:06:04 mysqld started
    070722 16:06:04 [Warning] Setting lowercase_tablenames=2 because file system for /var/mysql/ is case insensitive
    070722 16:06:04 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    070722 16:06:05 InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 43634.
    /var/mysql has permissions 775.
    The line
    mysql.default_socket = /var/mysql/mysql.sock
    is in /etc/php.ini
    whereis mysqladmin ->
    /usr/bin/mysqladmin
    whereis mysql ->
    /usr/bin/mysql
    ls /var/mysql ->
    MyServer.local.err
    ib_logfile1
    mysql
    ib_logfile0
    ibdata1
    test
    Can't find my.cnf or my.ini anywhere
    Can't find mysql.sock anywhere
    I'm trying to get a bug database running (mantis) under Mac OS X Server 10.4.4 that I can access from local clients.
    I'm trying to follow directions at http://www.mantisbugtracker.com/manual/manual.installation.php
    without knowing anything about mysql or php and I'm stuck on step 3:
    "Next we will create the necessary database tables and a basic configuration
    file."
    I get a message saying
    "Does administrative user have access to the database? ( Lost connection to MySQL server during query )"
    I don't even know if following the mantis directions has resulted in the creation of a database or not. Where would it be?
    Thanks for any help.
    Intel iMac   Mac OS X (10.4.10)  

    I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
    The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
    e.g.
    cd /var
    sudo mkdir mysql <== this assumes the directory is missing
    cd mysql
    sudo ln -s /private/tmp/mysql.sock mysql.sock
    After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
    HTH
    Christian

Maybe you are looking for

  • Microsoft TechNet Wiki SharePoint 2010 Guru - Winners for December!!

    The results for December's TechNet Guru competition have been posted! http://blogs.technet.com/b/wikininjas/archive/2014/01/16/technet-guru-awards-december-2013.aspx Congratulations to all our new Gurus for December! We will be interviewing some of t

  • Issue with customer exit for copying one variable value to another

    Hello Gurus, I need to copy the value of a single value variable into another single customer exit variable. I coded as below.   WHEN 'customer_exit_var'.     IF I_STEP = 2. "after the popup       LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE       WHERE

  • Messed up library

    I decided to get OCD about my library and used TuneUp, Tagalicious and Song Genie. What I have now is a MESS!  I have two differnt songs with the same title and artist but they are entirely different songs. (Back in Black may really be Blue Eyes Cryi

  • Playing sounds in a Java Application?

    Hi, I am making a simple chat program, and want to include sounds for sending a receiving messages, but I can't seem to get it to work. First, does anybody have an easy solution to just Load 2 clips of aduio, and play them on-command? So when I send

  • How to rectify if there output comes to second line alv_list display

    this is code i have given. but what happens is that there are more field values.The output comes to the second line what is the problem, how can i rectify it CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING    I_CALLBACK_PROGRAM             = 'ZPTPR3