[SOLVED] MySQL queries

Hey guys just a quick one.  So I made a sweet script to install a wp from a repo version I have on my server.  From there using SED it makes it it's own new install.  So I was able to do the creating of the database, user, and privileges easily using mysql -u <user> -p<pass> -e "command" for each of those steps.  However here comes where i'm stuck.  So I still need to do these steps
USE $name;
UPDATE d3_wp_options SET option_value='http://$domain' WHERE option_name='siteurl';
UPDATE d3_wp_options SET option_value='$name' WHERE option_name='blogname';
UPDATE d3_wp_options SET option_value='' WHERE option_name='blogdescription';
UPDATE d3_wp_options SET option_value='http://$domain' WHERE option_name='home';
However my issue is if I use the above mentioned format to fire mysql queries in the script it will use $name and then when going to the next one it won't be in that database.  So my next thought was using a sub-script and exporting $name and $domain into that script and from there using those variables in the sub-script and just use the -e mysql command.  Is there an easier way to do this with out having to go into a sub-script, like a way to use mysql -u <user> -p<pass> -e and string all of those commands together?
Last edited by hauntedbyshadow (2014-07-21 12:36:37)

I'm not sure I understand your question.
If you are installing WP which runs in PHP would it not be easier to user PHP to do the installation? That way you could use an embedded procedure in the database and things would be easier.
I do not think you can open a connection to a DB with SED. Can you? And the only way I can see you keeping tabs on what tables/database you are calling is by having an embedded procedure at the DB level. Not to mention, it would be more secure and faster.
Just a thought.
R.

Similar Messages

  • Translating MSSQL to MySQL queries

    Is it possible to migrate with existing database from MSSQL to MySQL?
    I wander very much for application working in WIN32 environment (like wine) that translates queries for MSSQL to MySQL queries I mean the situation if some program would think it works with MSSQL but naturally it will work with MySQL carrying migration from MSSQL database with the same data.
    Many WIN32 programs use MSSQL mostly like databank.
    You guess I want to try to migrate with my production environment from Windows to Linux with some WIN32 application working. Is it possible?
    And I wander if MySQL stable equally comparing to MSSQL and have the same undo features.
    Does MySQL provide some WARRANTIES for production use?
    Thank you!

    Is it possible to migrate with existing database from MSSQL to MySQL?
    This is best answered by the MySQL people here:
    http://dev.mysql.com/tech-resources/art … osoft.html
    Notice that they have a discussion forum on the topic.
    And I wander if MySQL stable equally comparing to MSSQL and have the same undo features.
    In my experience MySQL is as good (and I think in fact better) but  that also depends on the intended use, server load, etc. so I'll live  it at that. You may want to have other opinions on the matter.
    Does MySQL provide some WARRANTIES for production use?
    Again let's MySQL speak by temselves:
    http://www.mysql.com/support/enterprise_support.html
    Hope this helps.
    Rick

  • Wierd behavior from MySQL queries

    I have a really frustrating problem in my JSP app that only seems to be occuring sporadically... I have to deploy it on an NT machine that is available right now. I'm using Tomcat/MySQL. I've had it on a W2000 machine and it has worked fine. To complicate things, the NT that it is on does have a proxy server that it must go through...it doesn't seem to want to work during the day, but in the evenings (presumably less traffic?), it has yet to fail me.
    The part of the app that won't update properly is responsible for letting people sign into an office cube daily, updating a seat table in the MYSQL database. It 1st checks to see if the person is assigned to another seat, and deletes that entry if they are. It then updates the seat table, replacing '0' (meaning no one's sitting here) with the person's emp_id. Here's the code for these 2 methods in the seat bean (with session scope):
    //1st method called...removes old entries...
    public void checkAndRemove(int newEmpId)
    throws SQLException {
    int oldSeat = 0;
    try{
    Connection conn = connectionPool.getConnection();
    Statement qs = conn.createStatement();
    ResultSet rs = qs.executeQuery("SELECT id FROM seat WHERE" +
    " id <> " + this.id + " AND emp_id = " + newEmpId +
    " AND editable = " + QUOTE + "y" + QUOTE);
    if(rs.next()) {
    oldSeat = rs.getInt(1);
    rs.close();
    qs.close();
    if(oldSeat > 0) {
    qs = conn.createStatement();
    rs = qs.executeQuery("SELECT COUNT(emp_id) FROM seat WHERE " +
    "id = "+ oldSeat);
    int cnt = rs.getInt(1);
    rs.close();
    qs.close();
    Statement us = conn.createStatement();
    if (cnt > 1) { //Is there more than 1 person at this old seat?
    //If so, we can delete this entry...
    us.executeUpdate("DELETE FROM seat" +
    " WHERE id = " + oldSeat + " AND emp_id = " + newEmpId);
    else {
    us.executeUpdate("UPDATE seat SET emp_id = 0,note= " + QUOTE + " " + QUOTE + " WHERE id = " + oldSeat + " AND emp_id = " + newEmpId);
    us.close();
    connectionPool.close(conn);
    catch(SQLException ex) {
    ex.printStackTrace();
    throw ex;
    //2nd method called, updates the seat with new emp...
    /**updateSeat updates seat information */
    public void updateSeat(int newEmpId, String newNote)
    throws SQLException {
    java.util.Date dt = new java.util.Date();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String timestamp = sdf.format(dt);
    newNote = escape(newNote); //escape any ' in the text...
    try{
    Connection conn = connectionPool.getConnection();
    Statement us = conn.createStatement();
    us.executeUpdate("UPDATE seat SET " +
    " emp_id= " + newEmpId + COMMA +
    "Note= " + QUOTE + newNote + QUOTE + COMMA +
    "Timestamp= " + QUOTE + timestamp + QUOTE +
    "WHERE seat.id = " + this.id + "AND seat.emp_id = " + this.empId);
    us.close();
    connectionPool.close(conn);
    catch(SQLException ex) {
    ex.printStackTrace();
    throw ex;
    The seat table has a primary key of id/emp_id.
    Like I said, these queries have worked fine on a different installation, and they work sporadically on this one. Any clues about this? Could some sort of 'timeout' be occuring and not throwing any errors?
    Any ideas/help would be greatly appreciated...
    Thanks, Mike

    Sorry. Let me clarify... While this app fails to properly insert into the database, the rest of the app functions as normal.
    Basically, when I click on a hotspot, I open a small window with javaScript. The window has a form that I fill out with emp info, then I submit it and it closes. Then, when someone clicks on that hotspot, the record that should have been created displays...
    This works some of the time, but when it doesn't, it simply displays a blank form, and based on a report run on another page, I know that it never inserted/updated the database. But never any error messages, etc.
    Mike

  • [SOLVED] MySQL woes...

    If i get this right, I need to run mysqld and then configure mysql with mysqladmin then it will work properly.  However, when I try to run mysqld, i get the following error message:
    050617 6:59:32 [Warning] Can't create test file /var/lib/mysql/localhost.lower-test
    050617 6:59:32 InnoDB: Operating system error number 13 in a file operation.
    InnoDB: The error means mysqld does not have the access rights to
    InnoDB: the directory.
    InnoDB: File name ./ibdata1
    InnoDB: File operation call: 'open'.
    InnoDB: Cannot continue operation.
    Being the n00b that i am, I have no idea what this means, and upon searching for the answer, i find myself further and further into linux confusion.  Thanks in advance
    *EDIT*  Sorry folks, solved the issue - for people with similiar problems, this is how i solved it:
    as root, i set chmod -R 777 /var/lib/mysql, from there the user account that i am running on has access to the files that i need to run mysql.

    Well thanks so much for the tip. /dev/disk/by-label works beautifully in grub and fstab.
    I suppose since I have 2 SATA controllers, they were fighting it out for supremacy or something, because during the installation the drive I installed Arch on was recognized as sdb, but after rebooting, it changes.....weird....

  • [SOLVED] mysql-5.0.24-2 broken?

    After upgrading to mysql-5.0.24-2 i've noticed that my site can't connect to mysql db and phpmyadmin says that php mysql.so module isn't loaded. I've checked configs and everything were ok, then i tried to "downgrade" mysql to mysql-5.0.24-1 and problem solved, just to be sure i upgraded mysql again and encountered same problem, so i'm running mysql-5.0.24-1 now. I think mysql-5.0.24-2 package is broken, anybody can confirm this?
    EDIT: Seems mysql-5.0.24-2 doesn't have mysql executable
    [root@host pkg]# mysql
    -bash: /usr/bin/mysql: No such file or directory

    Install mysql-clients and libmysqlclient. My guess is that you either didn't install it with a forced upgrade (-d option), or that pacman didn't like the files being on your system and decided to eat it for breakfast.

  • (solved)MySQL running out of connections...

    Hi,
    Not really a _problem_ as such, but I may have to look into this in the (near?) future, if my project goes live...
    I have an Applet that shows data from a server (on my network) - if I turn off the applet (stop Firefox all the way) and re-connect and do that several times, the server has "too many connections" and (obviously) will refuse to serve any further.
    Is there a way to effectively kill a connection?
    There is (scetchy) what I do at "unload"
    try
    cn.close();
    cn = null;
    catch(exception e)
    // no need to handle this?
    Fair enuff, the Applet does release the connection, but something still "lingers" on in the server...how do I clean that up as well?
    Any thoughts are welcome...no pressure here...
    Coolness to all
    Thor
    Edit - not really solved, but more "timed out"...
    Last edited by Thor@Flanders (2010-12-10 12:43:21)

    Hi Skunktrader,
    Nope, the exception still happens. I'll set up the server to do a garbage collect. And redirect the closing page/applet to a close page where I'd run a PHP script to close mysql down...by means of cleaning up...
    The thing is, if/when I wait a while, the exception does not manifest itself and the applet does start up. As if the server needs time to clean up...something I want to force it doing...right away.
    More to follow
    Thor
    Edit1 : still no luck - of course, the server is a recycled PC (256Mb ram) and CentOS 5.2, still more than 20Gb disk left. But... I am the only one on this thing...
    Any (I really mean ANY) thoughts (no matter how funny or off-topic, I could use SOME feedback here) are more than welcome...
    Edit2 : is it normal that my local JVM just ... stops? I've set the thing to display the console, just to see anything locally getting lost in the fog, but the panel stops, after a "ps -A" there is no more JVM inthe shop...
    I have to restart the applet several times to get it working, of course, every attempt leaves its marks on the server in still-open connections...
    I still invite ANYONE for thoughts, inputs, off-topics, ...
    Last edited by Thor@Flanders (2010-12-05 17:59:40)

  • [SOLVED] MySQL won't start

    Hi,
    I'm trying to configure MySQL: ArchWiki
    mysqld won't start. My /var/lib/mysql/stovepipebox.err:
    120310 16:24:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld: Table 'mysql.plugin' doesn't exist
    120310 16:24:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    120310 16:24:31 InnoDB: The InnoDB memory heap is disabled
    120310 16:24:31 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    120310 16:24:31 InnoDB: Compressed tables use zlib 1.2.6
    120310 16:24:32 InnoDB: Initializing buffer pool, size = 128.0M
    120310 16:24:32 InnoDB: Completed initialization of buffer pool
    120310 16:24:32 InnoDB: highest supported file format is Barracuda.
    InnoDB: The log sequence number in ibdata files does not match
    InnoDB: the log sequence number in the ib_logfiles!
    120310 16:24:32 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...
    120310 16:24:32 InnoDB: Waiting for the background threads to start
    120310 16:24:33 InnoDB: 1.1.8 started; log sequence number 1595675
    120310 16:24:33 [Note] Recovering after a crash using mysql-bin
    120310 16:24:33 [Note] Starting crash recovery...
    120310 16:24:33 [Note] Crash recovery finished.
    120310 16:24:33 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
    120310 16:24:33 mysqld_safe mysqld from pid file /var/lib/mysql/stovepipebox.pid ended
    Any ideas?
    Last edited by Llama (2012-03-11 15:35:41)

    Thanks! Unfortunately, I'm quite new to MySQL...
    # mysql_install_db --user=mysql --=/var/lib/mysql/
    FATAL ERROR: Could not find ./bin/my_print_defaults Why the leading period?
    If you compiled from source, you need to run 'make install' to
    copy the software into the correct location ready for operation.
    If you are using a binary release, you must either be at the top
    level of the extracted archive, or pass the --basedir option
    pointing to that location.
    BTW, it exists:
    $ locate my_print_defaults
    /usr/bin/my_print_defaults
    Last edited by Llama (2012-03-10 14:08:19)

  • [SOLVED] mySQL third party database?

    I think it is surprising that mySQL is threated as a third-party database or has Oracle sold it?
    "You can also connect to schemas for selected third-party (non-Oracle) databases, such as MySQL, Microsoft SQL Server, Sybase Adaptive Server, Microsoft Access, and IBM DB2, and view metadata and data."
    I have searched most of the documentation and the forum and now I think that I have to install some kind of driver (jdbc perhaps) and then I get a new tab in the connection view where I now only have the oracle tab.
    I tried to use the oracle connection tab and use a jdbc connection string: jdbc:mysql://localhost:3306/cdr?useUnicode=true&characterEncoding=utf-8 both with and without the unicode string but it did not work.
    Found it -> Help -> Developer Center -> JDBE my SQL driver (from my mind, just restarting it)
    Edited by: 992601 on 2013-mar-07 23:26

    Oracle SQL Developer is the IDE for Oracle Database. We also have an extension for TimesTen. But primarily any database support for databases other than Oracle is provided to assist with migrating you from those databases to Oracle.
    The MySQL team has it's own IDE, it's called the MySQL Workbench.
    http://dev.mysql.com/downloads/workbench/5.2.html
    You'll notice it does not support Oracle Database.

  • [solved] MySQL Connector C++ 1.0.5

    Hello everyone,
    I'm trying to connect to a MySQL db via C++. MySQL has the connector and API available for this. In the process of building this I've run into some troubles/questions.
    First off is that MySQL states that MySQL Workbench uses this connector:
    MySQL wrote:Note that MySQL Workbench is successfully using MySQL Connector/C++.
    source (at the bottom of the page) but I can't seem to find any files which are created by the connector itself.
    Second is that when I create a package file it contains files that - I think - shouldn't be included (or at least not in those directories).
    PKGBUILD used:
    pkgname=mysql-connector-c++
    pkgver=1.0.5
    pkgrel=1
    pkgdesc="MySQL Connector/C++ is a MySQL database connector for C++"
    arch=(i686)
    url="http://dev.mysql.com/doc/refman/5.1/en/connector-cpp.html"
    license=('gpl')
    depends=('mysql-clients')
    makedepends=('cmake>=2.4' 'glibc>=2.2.3')
    source=(http://download.softagency.net/MySQL/Downloads/Connector-C++/$pkgname-$pkgver.tar.gz)
    md5sums=('f0ad6655f3ea7db8df3215fa928cba03') #generate with 'makepkg -g'
    build() {
    cd "$srcdir/$pkgname-$pkgver"
    # remove file that is included in release but should be generated by cmake
    rm cppconn/config.h
    # remove some possible old cmake cache
    rm CMakeCache.txt
    # patch for use with gcc-4.4
    patch -p0 < ${startdir}/mysql-connector-cpp-1.0.5-gcc44.patch
    cmake -G "Unix Makefiles" .
    make clean
    make || return 1
    make DESTDIR="$pkgdir/" install
    # vim:set ts=2 sw=2 et:
    output of pacman -Qlp mysql-connector-c++-1.0.5-1-i686.pkg.tar.gz
    mysql-connector-c++ /usr/
    mysql-connector-c++ /usr/local/
    mysql-connector-c++ /usr/local/ANNOUNCEMENT
    mysql-connector-c++ /usr/local/COPYING
    mysql-connector-c++ /usr/local/README
    mysql-connector-c++ /usr/local/include/
    mysql-connector-c++ /usr/local/include/cppconn/
    mysql-connector-c++ /usr/local/include/cppconn/build_config.h
    mysql-connector-c++ /usr/local/include/cppconn/config.h
    mysql-connector-c++ /usr/local/include/cppconn/connection.h
    mysql-connector-c++ /usr/local/include/cppconn/datatype.h
    mysql-connector-c++ /usr/local/include/cppconn/driver.h
    mysql-connector-c++ /usr/local/include/cppconn/exception.h
    mysql-connector-c++ /usr/local/include/cppconn/metadata.h
    mysql-connector-c++ /usr/local/include/cppconn/parameter_metadata.h
    mysql-connector-c++ /usr/local/include/cppconn/prepared_statement.h
    mysql-connector-c++ /usr/local/include/cppconn/resultset.h
    mysql-connector-c++ /usr/local/include/cppconn/resultset_metadata.h
    mysql-connector-c++ /usr/local/include/cppconn/statement.h
    mysql-connector-c++ /usr/local/include/cppconn/warning.h
    mysql-connector-c++ /usr/local/include/mysql_connection.h
    mysql-connector-c++ /usr/local/include/mysql_driver.h
    mysql-connector-c++ /usr/local/lib/
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn-static.a
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so.1
    mysql-connector-c++ /usr/local/lib/libmysqlcppconn.so.1.0.5
    The files bothering me are:
    /usr/local/ANNOUNCEMENT
    /usr/local/COPYING
    /usr/local/README
    Anyone who can enlighten me?:rolleyes:
    Thanks in advance,
    Arjan Gelderblom
    Last edited by Bloged (2009-11-17 09:27:49)

    Bloged wrote:
    Thanks wonder for your reply.
    How do I move files using PKGBUILD? I've found an install -D command but that looks at best at copying the file:
    install -D COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
    Another question is that the patch that is executed is only for gcc-4.4 is there a way to have an if statement for that?
    no. we don't have any other version in our repo and that patch will work also with older gcc
    Edit: a simple solution is to copy them using install -D and then remove them... is this the correct sollution?
    yes. and remove the others two files as well.

  • [SOLVED] mysql upgrade stops mythtv working

    Just upgraded mysql and got the following message from pacman:
    [2009-11-18 10:19] >> MySQL configuration file now is into /etc/mysql/ directory.
    [2009-11-18 10:19] >> Remember to replace it with your old configuration file.
    [2009-11-18 10:19] upgraded mysql (5.1.39-1 -> 5.1.40-1)
    but where is my old configuration file? From Googleing I think the default is /etc/my.cnf but that file is not there. I don't remember editing a config file for mysql.
    I tried running with the new default file at /etc/mysql/my.cnf but I keep getting access denied messages when running mythtv and it cannot connect to the database. I logged into mysql as root and made sure of the mythtv user password, made sure they had full privileges on the mythconverg database but still no change.
    Any ideas what to try?
    For now I have downgraded back to 5.1.39-1 and all's working ok.
    Last edited by fastfret79 (2009-11-18 16:37:25)

    Well that explains why I couldn't find it! Looking now after downgrading it is at /etc/my.cnf, but the /etc/mysql/my.cnf has now been removed so I can't compare them at the moment.
    Mythtv is the only reason I have mysql, but I don't think that mythtv has anything to do with it and I don't think rebuilding it will help. i.e. when running the following
    mysql -u mythtv -p mythconverg
    this works with 5.1.39-1 but with 5.1.40-1 it throws up the permission denied message.
    I'm gonna digg around again later (when mythtv isn't recording anything!) to get to the bottom of this.

  • [SOLVED] MySQL Server issues

    I just installed a fresh ArchLinux, restored a backup from an Ubuntu natty, everything works except my MySQL server connections.
    I cannot connect with odbc or jdbc, I'm using the latest versions available:
    $ pacman -Q mysql unixodbc myodbc jre
    mysql 5.5.12-1
    unixodbc 2.3.0-1
    myodbc 5.1.8-1
    jre 6u25-1
    $ mysql -u mencargo -p
    Server version: 5.5.12 Source distribution
    mysql> use etlcontroltf;
    Database changed
    mysql>
    $ cat /etc/odbcinst.ini
    [MySQL]
    Description = ODBC Driver for MySQL
    Driver = /usr/lib/libmyodbc5.so
    $ cat .odbc.ini
    [MySQL]
    Description = MySQL ODBC
    Driver = MySQL
    Server = localhost
    Database = etlcontroltf
    Port = 3306
    Socket = /var/run/mysqld/mysqld.sock
    $ isql MySQL -v
    [01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/libmyodbc5.so' : file not found
    [ISQL]ERROR: Could not SQLConnect
    $ lsd /usr/lib/libmyodbc5.so
    lrwxrwxrwx 1 root 19 Mar 17 09:05 /usr/lib/libmyodbc5.so -> libmyodbc5-5.1.8.so
    For JDBC I'm trying to use mysql-connector-java-5.1.16-bin.jar with DBvisualizer, getting:
    Product:  DbVisualizer Free 7.1.5
    Build:  #1590 (2011/02/24 17:23)
    Java VM:  Java HotSpot(TM) 64-Bit Server VM
    Java Version:  1.6.0_25
    Java Vendor:  Sun Microsystems Inc.
    OS Name:  Linux
    OS Arch:  amd64
    OS Version:  2.6.38-ARCH
    An error occurred while establishing the connection:
    Long Message:
    Communications link failure
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    Details:
       Type: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
       Error Code: 0
       SQL State: 08S01
    A curious thing about the odbc is that the Arch guide suggests a /usr/lib/libodbcmyS.so file that is not present in my system, or any libodbcmySX.so nor libmyodbcSX.so.
    Anyway, jdbc doesn't have anything to do with odbc, and it's also not working, so maybe it's my server config?
    $ cat /etc/mysql/my.cnf
    [client]
    port = 3306
    socket = /var/run/mysqld/mysqld.sock
    [mysqld]
    port = 3306
    socket = /var/run/mysqld/mysqld.sock
    datadir = /var/lib/mysql
    skip-external-locking
    key_buffer_size = 64M
    max_allowed_packet = 2M
    table_open_cache = 64
    sort_buffer_size = 1M
    net_buffer_length = 512K
    read_buffer_size = 2M
    read_rnd_buffer_size = 1M
    myisam_sort_buffer_size = 16M
    bind-address = 127.0.0.1
    server-id = 1
    [mysqldump]
    quick
    max_allowed_packet = 64M
    [mysql]
    no-auto-rehash
    [myisamchk]
    key_buffer_size = 32M
    sort_buffer_size = 32M
    read_buffer = 16M
    write_buffer = 16M
    Or is this version of the server broken?
    Last edited by mencargo (2011-06-03 05:49:11)

    The my.cnf code posted is the whole config, I don't have skip-networking.
    $ telnet localhost 3306
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    Connection closed by foreign host.
    $ netop
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1483/mysqld
    tcp 0 0 127.0.0.1:3306 127.0.0.1:43098 TIME_WAIT -
    The port seems open but I'm getting disconnected immediately.
    Any thoughts?
    Last edited by mencargo (2011-05-09 02:04:58)

  • [SOLVED] MySQL working w/all but myth (can't connect to DB)

    Just did ye ol' upgrade and
    > sudo tail -f /var/lib/mysql/mythbox.err
    091121 18:29:38 [Note] /usr/sbin/mysqld: Shutdown complete
    091121 18:29:38 mysqld_safe mysqld from pid file /var/lib/mysql/mythbox.pid ended
    091121 18:30:51 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    091121 18:30:53 [Note] Plugin 'FEDERATED' is disabled.
    091121 18:30:53 [Note] Plugin 'ndbcluster' is disabled.
    091121 18:30:54 InnoDB: Started; log sequence number 0 193508
    091121 18:30:55 [Note] Event Scheduler: Loaded 0 events
    091121 18:30:55 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.1.41' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Source distribution
    No errors from mysql after some db checking and upgrading (and was all OKs from that). Mythfrontend output:
    2009-11-21 18:39:52.271 Testing network connectivity to '192.168.1.100'
    2009-11-21 18:39:52.278 Closing DB connection named 'DBManager0'
    2009-11-21 18:39:52.279 Unable to connect to database!
    2009-11-21 18:39:52.279 Driver error was [1/2003]:
    QMYSQL: Unable to connect
    Database error was:
    Can't connect to MySQL server on '192.168.1.100' (111)
    2009-11-21 18:39:52.279 Cannot login to database?
    I keep getting this, and mythbackend.log shows nothing helpful, just proper log entries/no errors or anything. My /etc/mysql/my.cnf is here if of any use: http://pastebin.ca/1681585
    I do have some other web apps using mysql that are functioning properly, so I'm pretty sure it's not mysql (?).
    Thanks for any help
    Last edited by colbert (2009-11-22 03:21:49)

    Got it! Just edit your /etc/mysql/my.cnf and find the line
    skip-networking
    Comment the line out and it connects just fine from a remote FE

  • [SOLVED] MYSQL error about socketfiles!

    Hello, I installed mysql with pacman but cannot figure out how to run it!
    Running mysql_secure_installation give me this error:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    /etc/rc.d/mysqld start just say FAIL
    /var/lib/mysql and all files there are owned by mysql, mysql
    Can anyone please help me!
    Last edited by CheatCat (2010-06-24 19:29:33)

    looks like mysql isnt running, check /etc/mysql/my..cnf to check if any settings needs to be altered. also, it might be that the file <hostname>.pid exists in /var/lib/mysql , if there is then you should remve it and then try starting mysql.

  • [SOLVED] mysql-5.5.8-3 won't start

    hello,
    after upgrading mysql today, it wont start anymore...
    root@karoshiPC ~ > /etc/rc.d/mysqld start
    :: Starting MySQL Server [FAIL]
    root@karoshiPC ~ > mysqld_safe --datadir=/var/lib/mysql/
    101222 19:49:42 mysqld_safe Logging to '/var/lib/mysql//karoshiPC.err'.
    101222 19:49:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql/
    101222 19:49:43 mysqld_safe mysqld from pid file /var/lib/mysql//karoshiPC.pid ended
    My /var/lib/mysql:
    root@karoshiPC mysql > ls -al
    total 28700
    drwxr-xr-x 4 mysql mysql 4096 Dec 22 19:49 .
    drwxr-xr-x 27 root root 4096 Dec 22 19:23 ..
    -rw-rw---- 1 mysql mysql 18874368 Dec 22 19:49 ibdata1
    -rw-rw---- 1 mysql mysql 5242880 Dec 22 19:49 ib_logfile0
    -rw-rw---- 1 mysql mysql 5242880 Dec 22 19:46 ib_logfile1
    -rw-rw---- 1 mysql mysql 9175 Dec 22 19:49 karoshiPC.err
    drwxr-xr-x 2 mysql mysql 4096 Dec 22 15:27 mysql
    -rw-rw---- 1 mysql mysql 0 Dec 22 19:46 mysql-bin.index
    drwxr-xr-x 2 mysql mysql 4096 Dec 22 15:27 test
    The two slashes in
    101222 19:49:43 mysqld_safe mysqld from pid file /var/lib/mysql//karoshiPC.pid ended
    look weird, but thats just a guess.
    EDIT:
    Also Akonadi from [kde-unstable], using internal MYSQL Server, won't start anymore...
    Last edited by karoshi (2010-12-22 19:19:26)

    this is fixed in mysql 5.5.8-4.
    Amarok does not start neither but this is an upstream bug: https://bugs.kde.org/show_bug.cgi?id=252424

  • [SOLVED] Mysql doesn't start, Can't change dir to '/var/lib/mysql/'

    My mysql install was working fine but now it doesn't start
    $ mysqld --verbose
    121202 22:41:34 [Warning] Can't create test file /var/lib/mysql/home.lower-test
    121202 22:41:34 [Warning] Can't create test file /var/lib/mysql/home.lower-test
    mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
    121202 22:41:34 [ERROR] Aborting
    121202 22:41:34 [Note] mysqld: Shutdown complete
    I checked using mysql_safe & it seems to be a permission issue
    $ mysqld_safe --user=mysql
    121202 22:45:34 mysqld_safe Logging to '/var/lib/mysql/home.err'.
    121202 22:45:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld_safe: line 107: /var/lib/mysql/home.err: Permission denied
    rm: cannot remove ‘/var/run/mysqld/mysqld.sock’: Permission denied
    rm: cannot remove ‘/var/lib/mysql/home.pid’: Permission denied
    /usr/bin/mysqld_safe: line 144: /var/lib/mysql/home.err: Permission denied
    121202 22:45:35 mysqld_safe mysqld from pid file /var/lib/mysql/home.pid ended
    /usr/bin/mysqld_safe: line 107: /var/lib/mysql/home.err: Permission denied
    But the thing is /var/lib/mysql is already owned by mysql,
    $ ls -la /var/lib/ | grep mysql
    drwxrw-r-- 19 mysql root 4.0K Dec 2 22:29 mysql
    $ ls -la /var/ | grep lib
    drwxr-xr-x 29 root root 4.0K Nov 28 19:59 lib
    $ ls -la / | grep var
    drwxr-xr-x 13 root root 4.0K Nov 28 19:58 var
    so anyone tell me what permissions I have gotten wrong & how can I get mysql to work again?
    Last edited by cool (2012-12-02 18:26:18)

    1. You have to start mysqld as root using either sudo or from your root account
    2. The safest way to start mysql is using the unit file (systemd) or service file (rc.d) -- e.g. 'sudo systemctl mysqld start'
    3. My /var/lib/mysql directory has the following permissions 700 and owner/group is mysql/mysql. With those permissions, you're not going to be able to view the contents of the directory unless you are root or that user.
    Scott

Maybe you are looking for

  • No picture colour on ipod touch

    Hi, I have no colour picture on my ipod touch - all i get is a negative picture image(like an old photograph negative image) any ideas how to reslove this issue?

  • 11g how to get participant information

    how can I get the participant from a human task in 11g? Can I map something from the execData on output? I want to maintain a variable 'lastParticipant' throughout the process. Alternatively I could use it in a managed bean if I knew how to extract i

  • Non-blocking serialization

    Dear all, Does anybody know whether PI/XI supports the non-blocking serialization function? And in which version? If not, is there any work-around? Thanks a lot. best regards Jing

  • Portlet Header action Refresh

    I have created my first JSR-168 portlet and consumed it in the JSF page. Everything looks good with my AJAX stuff except my JavaScript does not get called when clicking on the "Refresh" action from the portlet header menu. My portlet calls the JavaSc

  • Upgrades consistently failing...

    Every upgrade from Adobe is failing to run. I need some support. What I'm dealing with seems so insain I spent the last few days looking for some kind of malware problem. I've scanned my system with multiple tools and can't find anything. Acrobat, Ph