About mySQL

Hi,
I'm having trouble with mySQL about the subselect, even setting ultraDevHack to true.
I'm using mySQL 3.23.53 with JDBC driver mysql-connector-java-2.0.14-bin.jar
Any suggestions ?
Thanks.

the ultraDevHack parameter only enables the usage of prepared statements. There is a newer "unstable" release of the Connector/J package from www.mysql.com which might allow subselects.
Mike
Does UltraDevHack have anything to do with subselects? I thought MySQL 3.* does not support subselects at all..

Similar Messages

  • Question about mysql and phpbb3. (Easy question to many people.)

    If you go to http://deecode.bounceme.net (My server) You can see that I have put phpBB3 on it. When I go under the install section it doesn't detect that I have installed mysql even though I have. Is there a configuration that I need to change to get this to work? I have the mysql daemon running, and I've checked all the wikis on how to do this, but none have helped.
    Any help here?

    ... mod_logio mod_mime mod_mime_magic mod_negotiation mod_proxy ...
    Nothing about mysql
    search for :
    extension=mysql.so
    in php.ini, if there is à " ; " remove it.
    Don't forget to restart httpd :
    # /etc/rc.d/httpd restart

  • What's wrong! about MySQL C APIs

    #include <mysql/mysql.h>
    #include <stdio.h>
    int main()
    MYSQL mysql;
    mysql_init(&mysql);
    mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name");
    if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0))
    fprintf(stderr, "Failed to connect to database: Error: %sn",
    mysql_error(&mysql));
    return 0;
    This code are from mysql manual.
    When I try to compile it, I get the following message:
    /tmp/ccojokYy.o(.text+0x29): In function `main':
    : undefined reference to `mysql_init'
    /tmp/ccojokYy.o(.text+0x47): In function `main':
    : undefined reference to `mysql_options'
    /tmp/ccojokYy.o(.text+0x8d): In function `main':
    : undefined reference to `mysql_real_connect'
    /tmp/ccojokYy.o(.text+0xa4): In function `main':
    : undefined reference to `mysql_error'
    collect2: ld returned 1 exit status

    What command line did you use to compile?
    Did  you linked with the mysql library?

  • Question about mysql in OSX

    Any experts out there on using mysql within OSX?
    Here's what I'm puzzling over. Mysql (5.0) stores its databases in /usr/local/mysql/data. I would like to have one of the databases stored elsewhere (so I can keep it encrypted inside another user's account using filevault).
    Is there a way to get mysql to do this? I tried just using an OSX alias, but mysql did not seem to recognize the re-direction.
    Any ideas? Thanks in advance.
    Eric

    Actually, I've done this myself, and it works great if you are logged in as the user of that FileVault account (and you manually start mysql).
    I've found that a much better way is just to create an encrypted disk image (use diskutil), and then point your mysql data directory to that mount point (/Volumes/myencrypteddisk), then anyone user knows the password for that volume can mount it then start mysql.
    The problem is that this is a bit tedious, in that you can't set mysql up to just load when you start up your machine. You have to manually mount the drive first. If you launch the mysqld before mounting the drive, it'll throw an error.
    Hope that helps.
    If you want a more step-by-step, just let me know.
    Quad G5   Mac OS X (10.4.7)  

  • About mysql character encoding problem

    I have a system with mysql database, in the system all encoding is UTF-8, i want to know if in client which is use utf-8 encoding and then send the form data to server side process. The server will do some process like insert data to database, if i no set the mysql encoding, default is latin1, the data from client side to server and then insert to database, the data in database is utf8 or others? thanks

    If you do not change the MySQL encoding, MySQL will use the default encoding which is latin1. All data inserted to the database will then be in latin1.

  • About mysql 6.0 data

    Hi friends,
    I was using mysql 4.0 as my data base before one week and now I have to use mysql 6.0 to store my data. Now in mysql 4.0 I was having a folder named data from where I can get my full data I can't get that folder in mysql 6.1 and I have to take back up from my older data base and it is in bulk. So can any one say me from where can I get that data folder?
    Waiting for reply....
    Thanks in advance.
    Hirav

    There is a utility called SQLdump or something, try googling for it.

  • Question About mysql

    Hello All :-)
    i need mysql on mine pc boz of mine project with PHP. i just want to know whts the exact size of the mysql i find through "pacman " it shows 25.33 mb. and what are its other dependencies.
    Please Guide me.
    Thanks

    Why is this topi in the General Programming Forum ?

  • [Solved] Should I worry about mysql?

    During today's upgrade I got this message:
    ( 5/199) upgrading mysql [######] 100%
    error: command failed to run correctly
    I am not using mysql, but perhaps the system is.
    Should I worry?
    Last edited by whaler (2010-03-03 17:04:38)

    Find out what packages you have the require it and work out from there what functionality they need from mysql:
    pacman -Qi mysql | grep Required

  • Question about MySQL, JDBC, SQLJ, Stored procedure & callable statements

    Hi, there. I'm using j2sdk1.4.1_01 and MySQL ver 12.18 Distrib 4.0.12, and when I try to install a store procedure, it throws the following message:
    SQLException: Stored procedures not supported: {call sqlj.install_jar('blah...blah...MyProject-20031206.jar', 'routines_jar', 0)}
    Who's is not supporting store procedures here? Java or MySQL? What can I do?
    The book and sample code I'm using as a reference mention that "the sample code assumes that the DBMS already stores the built-in SQLJ procedure sqlj.install_jar, which loads a set of classes written in the Java programming language in an SQL system". Now my question is: the "SQLJ procedure sqlj.install_jar" is something extra that I need to install or it has nothing to do with the problem?
    Is it true that MySQL does not support stored procedures? Thank you in advance for any hint or suggestion.
    Regards,
    Hector.

    Who's is not supporting store procedures here? Java or
    MySQL?MySQL.
    What can I do?1. Don't use stored procedures.
    2. Use a database that supports stored procedures.
    3. Wait for the release of MySQL that does support stored procedures.

  • Question about Java MySQL connection

    Hi guys, greetings to y'all, me name is Ryan, I'm new 'round here.
    I have some questions, I have some application that I build with Java and using MSSQL Server 2000 as it's database, and now I want to try to use MySQL as it's database. I use MySQL server 5.0 and Navicat 8 for MySQL for the gateway and Win XP SP2 as my OS, what I want to know is, can you guys give me some connection string example for MySQL, for Java that is, I'm still learning in Java so sorry if I have some mistaken languages or code related words. Thanks a lot guys.
    Best Regards.

    Hi zahid, thanks for the reply, so if I have this code, like this one
    try
                                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                  Connection con;
                                  con=DriverManager.getConnection("jdbc:odbc:FlightSource","","");
                                  stat2=con.prepareStatement("insert into Passenger_Table(vPassenger_Name,vPassenger_gender,iPassenger_Age,vPassenger_Destination,vPass_FlightClass,vPass_FlightType,vDate_of_Issue,vDate_of_Departure,vDate_Expire,vForm_Payment,Card_No,vTotal_Price)values(?,?,?,?,?,?,?,?,?,?,?,?)");
                                  stat2.setString(1,textNama.getText());
                                  stat2.setString(2,(String.valueOf(entry2)));
                                  stat2.setString(3,textUmur.getText());
                                  stat2.setString(4,textTujuan.getText());
                                  stat2.setString(5,(String)comboKelas.getSelectedItem());
                                  stat2.setString(6,(String)comboJenisKeberangkatan.getSelectedItem());
                                  stat2.setString(7,(String)comboTglTiket.getSelectedItem()+"/"+texttgltiket1.getText()+"/"+texttgltiket2.getText());
                                  stat2.setString(8,(String)comboTglBerangkat.getSelectedItem()+"/"+texttglberangkat1.getText()+"/"+texttglberangkat2.getText());
                                  stat2.setString(9,(String)comboTglKadaluwarsa.getSelectedItem()+"/"+texttglkadaluwarsa1.getText()+"/"+texttglkadaluwarsa2.getText());
                                  stat2.setString(10,(String)comboPayType.getSelectedItem());
                                  stat2.setString(11,textCardNo.getText());
                                  //stat2.setFloat(12,Float.parseFloat(textHarga.getText()));
                                  stat2.setString(12,textHarga.getText());
                                  stat2.executeUpdate();
                                  JOptionPane.showMessageDialog(null, "The Data has successfully Booked " );
                             catch(Exception exception)
                                  JOptionPane.showMessageDialog(null,"Error encountered while entering data in the database: "+exception);
                             }I just simply change the Class.forName{} line right ?
    What About the database name, considering in the code above I used ODBC (the ODBC name is FlightSource), so the database was configured when I create the ODBC, then how about MySQL, should I create ODBC too to configured the database that I wanna use ?

  • Difference between RAC and MySQL Cluster !

    Difference between RAC and MySQL Cluster
    Please write me in well explanation , with examples , needed useful link and all other stuffs.
    (1)Italian dealers/distributors for MySQL
    (2)Difference between RAC and MySQL Cluster
    (3)Pricing about MySQL and PostgreSQL
    (4)How and which type / Way to deliver support by MySQL
    (5)Security features about MySQL Vs Oracle
    (6)Management Console
    MySQL Vs Oracle
    Thanks in advance !
    MySQL Cluster

    Ha ha, most amusing.
    I suggest you try googling for answers to these things. This is a site dedicated to the Oracle database, the questions are answered by volunteers (not Oracle employees) and we are primarily geeks rather than marketing droids. If you have a specific Oracle question please feel free to post anytime.
    Thank you for your interest.
    Arrivederci, APC

  • Any way to use OBDC in SAP to access MySQL DB and retrieve data

    I'd like to logon to an external MySQL DB (can de done easily enough with PHP)   but I'd like to do it with ABAP if possible.
    Connecting via OBDC I should be able to retreive the data from the DB  and then use it in my SAP application.
    Some databases will allow connection via
    EXEC SQL.
    connect to :dbsid
      ENDEXEC.
    EXEC SQL.
        set connection :dbsid
      ENDEXEC.
    EXEC SQL.
      open xxxxxxx for
      select
    ...... data from external DB
    from tablespace in external db
    ENDEXEC.
    do.
      EXEC SQL.
        fetch next XXXXXX into
               :db_table_field, .... etc
                 ENDEXEC.
      if sy-subrc ne 0.
        exit.
      endif.
      insert table int_sap_table.
    enddo.
    EXEC SQL.
      close XXXXXX
    ENDEXEC.
    If you can make this type of stuff work for a MySQL DB i'd appreciate the answer.
    Using PHP has a drawback as you need to have it installed on the front end PC and run in Foreground.
    The EXEC SQL commands run in batch which is what you need if you are talking about 100,000's of records from an external DB.
    Cheers
    jimbo

    Hi Graham
    Currently it doesn't seem to support MySQL.
    Now that SAP has taken over again the development of MAXDB I can't see it providing  direct MySQL to SAP functionality.
    MAXDB is available but that would mean changing the entire architecture and we don't want to do that.
    I think probably the best route to go would be to create a BAPI which is capable of performing a logon to the remote  MySQL DB server, get the data and either send it back as  IDOCS, an external flat file, or as an internal table depending on the volume of data to be retrieved.
    The good thing about MySQL is that the command line interface makes logging on and retrieving data quite simple.
    This data is actually wanted in a BI  / BW system to provide for a number of business proces analyses.
    I did think abut using "Web Services"  but the data retrieval will essentially be done offline.
    There is no requirement currently for transferring data FROM SAP back to the MySQL database ( although if you've ever dealt with top level management you know how quickly developments can change).
    PHP for all it's drawbacks is the really easy way - but we'll have a problem doing this in background from the SAP servers. For foreground tasks it's a real doddle if you have php on your front end.
    for example
    <?php
    $username = "pee_wee";
    $password = "let_me_in";
    $hostname = "localhost";        */* IP address of remote DB server */*
    $dbh = mysql_connect($hostname, $username, $password)
    or die("Unable to connect to MySQL");
    print "Connected to MySQL<br>";
    // you're going to do lots more here soon
    mysql_close($dbh);
    ?>
    Batch mode also seems OK  also from the documentation
    http://dev.mysql.com/doc/refman/5.1/en/batch-mode.html
    so running an ABAP which can issue system commands (readily available) should work in theory provided the SAP server can connect to the remote MySQL server machine.
    Thanks for your suggestions however
    Cheers
    jimbo

  • Re: MySQL Database - NOT SAVING USER WEB-FORM DATA, ANY SUGGESTIONS...

    Hi, after adding the missing <html> tag, still doesn't make any difference, see below the php code and html form in context, the one you've asked me to paste.
    Note: I am trying to incorporate this, into an existing webpage, "the html form has to work with the existing html tags without duplicating" it's an existing webpage currently online.
    *Corrected the typing error Murray mentioned previously, about mysqli
    THE PHP CODE...
    <?php
    class MySessionHandler implements SessionHandlerInterface
    private $savePath;
    public function open($savePath, $sessionName)
      $this->savePath = $savePath;
      if (!is_dir($this->savePath)) {
       mkdir($this->savePath, 0777);
      return true;
    public function close()
      return true;
    public function read($id)
      return (string)@file_get_contents("$this->savePath/sess_$id");
    public function write($id, $data)
      return file_put_contents("$this->savePath/sess_$id", $data) === false ? false : true;
    public function destroy($id)
      $file = "$this->savePath/sess_$id";
      if (file_exists($file)) {
       unlink($file);
      return true;
    public function gc($maxlifetime)
      foreach (glob("$this->savePath/sess_*") as $file) {
       if (filemtime($file) + $maxlifetime < time() && file_exists($file)) {
        unlink($file);
      return true;
    $handler = new MySessionHandler();
    session_set_save_handler($handler, true);
    session_start();
    ?>
    <?php
    class session {
    var $lifeTime;
    var $dbHandle;
    function open($savePath, $sessName) {
      $this->lifeTime = get_cfg_var("session.gc_maxlifetime");
      $dbHandle = @mysql_connect("server", "user","password");
      $dbSel = @mysql_select_db("database",$dbHandle);
      if(!$dbHandle || !$dbSel)
       return false;
      $this->dbHandle = $dbHandle;
      return true;
    function close() {
      $this->gc(ini_get("session.gc_maxlifetime"));
      return @mysql_close($this->dbHandle);
    function read($sessID) {
      $res = mysql_query("SELECT session_data AS d FROM ws_sessions
         WHERE session_id = '$sessID'
         AND session_expires > " .time(), $this->dbHandle);
      if($row = mysql_fetch_assoc($res))
         return $row['d'];
      return "";
    function write($sessID, $sessData) {
      $newExp = time() + $this->lifeTime;
      $res = mysql_query("SELECT * FROM ws_sessions
         WHERE session_id = '$sessID'", $this->dbHandle);
      if(mysql_num_rows($res)) {
       mysql_query("UPDATE ws_sessions
          SET session_expires = '$newExp',
          session_data = '$sessData'
          WHERE session_id = '$sessID'", $this->dbHandle);
       if(mysql_affected_rows($this->dbHandle))
          return true;
      else {
       mysql_query("INSERT INTO ws_sessions (
          session_id,
          session_expires,
          session_data)
          VALUES(
          '$sessID'
          '$newExp'
          '$sessData')", $this->dbHandle);
       if(mysql_affected_rows($this->dbHandle))
          return true;
      return false;
    function destroy($sessID) {
      mysql_query("DELETE FROM ws_sessions WHERE session_id = '$sessID'", $this->dbHandle);
      if(mysql_affected_rows($this->dbHandle))
         return true;
      return false;
    function gc($sessMaxLifeTime) {
      mysql_query("DELETE FRKOM ws_sessions WHERE session_expires < " .time(), $this->dbHandle);
      return mysql_affected_rows($this->dbHandle);
    $session = new session();
    session_set_save_handler(array(&$session,"open"),
        array(&$session,"close"),
    array(&$session,"read"),
    array(&$session,"write"),
    array(&$session,"destroy"),
    array(&$session,"gc"));
    session_start();
    ?>
    <?php
    $conn = new mysqli("1and1.com", "dbo501129768", "simpsys", "db501129768");
    if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . ') '  //CHECK CONNECTION.
       . $mysqli->connect_error);
    if (array_key_exists('submit', $_POST)){
    $userName = $_POST['username'];
    $firstName = $_POST['firstname'];
    $lastNmae = $_POST['lastname'];
    $password = $_POST['password'];
    $confirmPassword = $_POST['confirmPassword'];
    $conn->query("INSERT INTO ws_sessions (`user_name`, `first_name`, `last_name`, `email`, `password`, `confirm_password`) VALUES('$userName', '$firstName', '$lastName', '$email', '$password', '$confirmPassword')");
    ?>
    THE HTML FORM...   EDITED
    <!DOCTYPE html>
    <html>
    <head>
    <title>Admin</title>
    </head>
    <body>
    <form name='registration' method='post' action='insert_2.php' enctype="application/x-www-form-urlencoded">
        <p>Username: *</p>
        <p>
        <label for='username'></label>
        <input type='text' name='username' maxlength='40' size='60' tabindex='1'/>
        </p>
    <p>Firstname: *</p>
    <p>
    <label for='firstname'></label>
    <input type='text' name='firstname' maxlength='40' size='60' tabindex='2'/>   
    <p>Lastname: *</p>
    <p>
    <label for='lastname'></label>
    <input type='text' name='lastname' maxlength='40' size='60' tabindex='3'/>
        <p>Email: *</p>
        <p>
        <label for='email'></label>
        <input type='text' name='email' maxlength='40' size='60' tabindex='4'/>
        </p>
        <p>Password: *</p>
        <p>
        <label for='password'></label>
        <input type='password' name='password' id='password' maxlength='40' size='60' tabindex='5'/>
        </p>
        <p>Confirm password: *</p>
        <p>
        <label for='confirm password'></label>
        <input type='password' name='confirmPassword' id='confirmPassword' maxlength='40' size='60' tabindex='6'/>
        </p>
        <p>
        <input type='submit' value='Register'/>
        </p>
        <p> </p>
    </form>
    </body>
    </html> End of Form
    </div> "This tag and the ones below already exist inside the webpage"
    </div>
    </body>
    </html>
    I hope this helps - I appreciate your help.
    smartCode

    smartCode wrote:
    Hi, after adding the missing <html> tag, still doesn't make any difference, see below the php code and html form in context, the one you've asked me to paste.
    Note: I am trying to incorporate this, into an existing webpage, "the html form has to work with the existing html tags without duplicating" it's an existing webpage currently online.
    *Corrected the typing error Murray mentioned previously, about mysqli
    THE PHP CODE...
    <?php
    class MySessionHandler implements SessionHandlerInterface
    private $savePath;
    public function open($savePath, $sessionName)
      $this->savePath = $savePath;
      if (!is_dir($this->savePath)) {
       mkdir($this->savePath, 0777);
      return true;
    public function close()
      return true;
    public function read($id)
      return (string)@file_get_contents("$this->savePath/sess_$id");
    public function write($id, $data)
      return file_put_contents("$this->savePath/sess_$id", $data) === false ? false : true;
    public function destroy($id)
      $file = "$this->savePath/sess_$id";
      if (file_exists($file)) {
       unlink($file);
      return true;
    public function gc($maxlifetime)
      foreach (glob("$this->savePath/sess_*") as $file) {
       if (filemtime($file) + $maxlifetime < time() && file_exists($file)) {
        unlink($file);
      return true;
    $handler = new MySessionHandler();
    session_set_save_handler($handler, true);
    session_start();
    ?>
    <?php
    class session {
    var $lifeTime;
    var $dbHandle;
    function open($savePath, $sessName) {
      $this->lifeTime = get_cfg_var("session.gc_maxlifetime");
      $dbHandle = @mysql_connect("server", "user","password");
      $dbSel = @mysql_select_db("database",$dbHandle);
      if(!$dbHandle || !$dbSel)
       return false;
      $this->dbHandle = $dbHandle;
      return true;
    function close() {
      $this->gc(ini_get("session.gc_maxlifetime"));
      return @mysql_close($this->dbHandle);
    function read($sessID) {
      $res = mysql_query("SELECT session_data AS d FROM ws_sessions
         WHERE session_id = '$sessID'
         AND session_expires > " .time(), $this->dbHandle);
      if($row = mysql_fetch_assoc($res))
         return $row['d'];
      return "";
    function write($sessID, $sessData) {
      $newExp = time() + $this->lifeTime;
      $res = mysql_query("SELECT * FROM ws_sessions
         WHERE session_id = '$sessID'", $this->dbHandle);
      if(mysql_num_rows($res)) {
       mysql_query("UPDATE ws_sessions
          SET session_expires = '$newExp',
          session_data = '$sessData'
          WHERE session_id = '$sessID'", $this->dbHandle);
       if(mysql_affected_rows($this->dbHandle))
          return true;
      else {
       mysql_query("INSERT INTO ws_sessions (
          session_id,
          session_expires,
          session_data)
          VALUES(
          '$sessID'
          '$newExp'
          '$sessData')", $this->dbHandle);
       if(mysql_affected_rows($this->dbHandle))
          return true;
      return false;
    function destroy($sessID) {
      mysql_query("DELETE FROM ws_sessions WHERE session_id = '$sessID'", $this->dbHandle);
      if(mysql_affected_rows($this->dbHandle))
         return true;
      return false;
    function gc($sessMaxLifeTime) {
      mysql_query("DELETE FRKOM ws_sessions WHERE session_expires < " .time(), $this->dbHandle);
      return mysql_affected_rows($this->dbHandle);
    $session = new session();
    session_set_save_handler(array(&$session,"open"),
        array(&$session,"close"),
    array(&$session,"read"),
    array(&$session,"write"),
    array(&$session,"destroy"),
    array(&$session,"gc"));
    session_start();
    ?>
    <?php
    $conn = new mysqli("1and1.com", "dbo501129768", "simpsys", "db501129768");
    if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . ') '  //CHECK CONNECTION.
       . $mysqli->connect_error);
    if (array_key_exists('submit', $_POST)){
    $userName = $_POST['username'];
    $firstName = $_POST['firstname'];
    $lastNmae = $_POST['lastname'];
    $password = $_POST['password'];
    $confirmPassword = $_POST['confirmPassword'];
    $conn->query("INSERT INTO ws_sessions (`user_name`, `first_name`, `last_name`, `email`, `password`, `confirm_password`) VALUES('$userName', '$firstName', '$lastName', '$email', '$password', '$confirmPassword')");
    ?>
    THE HTML FORM...   EDITED
    <!DOCTYPE html>
    <html>
    <head>
    <title>Admin</title>
    </head>
    <body>
    <form name='registration' method='post' action='insert_2.php' enctype="application/x-www-form-urlencoded">
        <p>Username: *</p>
        <p>
        <label for='username'></label>
        <input type='text' name='username' maxlength='40' size='60' tabindex='1'/>
        </p>
    <p>Firstname: *</p>
    <p>
    <label for='firstname'></label>
    <input type='text' name='firstname' maxlength='40' size='60' tabindex='2'/>   
    <p>Lastname: *</p>
    <p>
    <label for='lastname'></label>
    <input type='text' name='lastname' maxlength='40' size='60' tabindex='3'/>
        <p>Email: *</p>
        <p>
        <label for='email'></label>
        <input type='text' name='email' maxlength='40' size='60' tabindex='4'/>
        </p>
        <p>Password: *</p>
        <p>
        <label for='password'></label>
        <input type='password' name='password' id='password' maxlength='40' size='60' tabindex='5'/>
        </p>
        <p>Confirm password: *</p>
        <p>
        <label for='confirm password'></label>
        <input type='password' name='confirmPassword' id='confirmPassword' maxlength='40' size='60' tabindex='6'/>
        </p>
        <p>
        <input type='submit' value='Register'/>
        </p>
        <p> </p>
    </form>
    </body>
    </html> End of Form
    </div> "This tag and the ones below already exist inside the webpage"
    </div>
    </body>
    </html>
    I hope this helps - I appreciate your help.
    smartCode
    I'm trying to establish if the code I supplied is working or not, i.e. if something is being inserted into your database or not. Including all the other php classes/functions does not help at this time as there is probably some conflict going on -  you CAN'T mix mysqli and mysql
    What happens if you just use the code below. Yes, it's a basic form and mysqli connection BUT it should insert something in your ws_sessions table.
    Then you can start adding in the other php  functions one by one and see where it breaks down.
    <?php
    $conn = new mysqli("1and1.com", "dbo501129768", "simpsys", "db501129768");
    if (array_key_exists('submit', $_POST)){
    $userName = $_POST['username'];
    $firstName = $_POST['firstname'];
    $lastNmae = $_POST['lastname'];
    $password = $_POST['password'];
    $confirmPassword = $_POST['confirmPassword'];
    $conn->query("INSERT INTO ws_sessions (`user_name`, `first_name`, `last_name`, `email`, `password`, `confirm_password`) VALUES('$userName', '$firstName', '$lastName', '$email', '$password', '$confirmPassword')");
    ?>
    <!DOCTYPE html>
    <html>
    <head>
    <title>Admin</title>
    </head>
    <body>
    <form name='registration' method='post' action='insert_2.php' enctype="application/x-www-form-urlencoded">
        <p>Username: *</p>
        <p>
        <label for='username'></label>
        <input type='text' name='username' maxlength='40' size='60' tabindex='1'/>
        </p>
    <p>Firstname: *</p>
    <p>
    <label for='firstname'></label>
    <input type='text' name='firstname' maxlength='40' size='60' tabindex='2'/>   
    <p>Lastname: *</p>
    <p>
    <label for='lastname'></label>
    <input type='text' name='lastname' maxlength='40' size='60' tabindex='3'/>
        <p>Email: *</p>
        <p>
        <label for='email'></label>
        <input type='text' name='email' maxlength='40' size='60' tabindex='4'/>
        </p>
        <p>Password: *</p>
        <p>
        <label for='password'></label>
        <input type='password' name='password' id='password' maxlength='40' size='60' tabindex='5'/>
        </p>
        <p>Confirm password: *</p>
        <p>
        <label for='confirm password'></label>
        <input type='password' name='confirmPassword' id='confirmPassword' maxlength='40' size='60' tabindex='6'/>
        </p>
        <p>
        <input type='submit' value='Register'/>
        </p>
        <p> </p>
    </form>
    </body>
    </html>

  • 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

  • Cannot initializy mysql for first use

    I installed coolstack 1.3 fine. But when i ran mysql_install_db --user=mysql
    It failed as follow. Any idea?
    thanks
    =========================================================
    bash-3.00# /opt/coolstack/mysql_32bit/bin/mysql_install_db --user=mysql
    bash-3.00# /opt/coolstack/mysql_32bit/bin/mysql_install_db --user=mysql
    Installing MySQL system tables...
    ERROR: 1062 Duplicate entry 'localhost-' for key 'PRIMARY'
    081209 21:25:34 [ERROR] Aborting
    081209 21:25:34 [Note] /opt/coolstack/mysql_32bit/bin/mysqld: Shutdown complete
    Installation of system tables failed! Examine the logs in
    /opt/coolstack/mysql_32bit/data for more information.
    You can try to start the mysqld daemon with:
    shell> /opt/coolstack/mysql_32bit/bin/mysqld --skip-grant &
    and use the command line tool /opt/coolstack/mysql_32bit/bin/mysql
    to connect to the mysql database and look at the grant tables:
    shell> /opt/coolstack/mysql_32bit/bin/mysql -u root mysql
    mysql> show tables
    Try 'mysqld help' if you have problems with paths. Using log
    gives you a log in /opt/coolstack/mysql_32bit/data that may be helpful.
    The latest information about MySQL is available on the web at
    http://www.mysql.com/. Please consult the MySQL manual section
    'Problems running mysql_install_db', and the manual section that
    describes problems on your OS. Another information source are the
    MySQL email archives available at http://lists.mysql.com/.
    Please check all of the above before mailing us! And remember, if
    you do mail us, you MUST use the /opt/coolstack/mysql_32bit/bin/mysqlbug script!
    bash-3.00#

    Goran O wrote:
    Try Administrator/Administrator, it works for sh.rpd and samplesales.rpd.
    Regards
    Goran
    http://108obiee.blogspot.com
    Thank you too!!

Maybe you are looking for