Nixed my mysql user, heh heh [SOLVED]

As noted in a previous post, I inadvertently deleted several system files, and I thereby lost my mysql user, so now the daemon can't start.
I made a user "mysql" but it didn't help.
Should I run mysql_secure_installation and first backup my config files? I did change those files a bit.
Thank you.
Last edited by CaptainKirk (2013-04-17 15:37:01)

Ask the allknowing wiki https://wiki.archlinux.org/index.php/De … D_Database

Similar Messages

  • Mysql user - ? password

    Hi all,
    New to OS X but not Linux. I see that a user 'mysql' exists on my machine. I do not see any way to assign it a password so I can use it as the root account for mysql. (I had to install as machine root to be able to log in with 'mysql -u root -p' and then respond with the password.
    It seems that the /usr/local/mysql directory should belong to mysql user instead of root.
    Anyway, I do not see any way to use netinfo to set mysql's password.
    Also, one big gap in the documentation on the Apple and MySQL web sites is that there is NO DISTINCTION between the machine's root user and MySQL's root user. Maybe there is none but that doesn't seem right to this neophyte.
    Open to all constructive criticism. It you can point be to the right refs I am more than willing to read up on this topic.
    Thanks,
    Bob

    Bob--
    New to OS X but not Linux. I see that a user
    'mysql' exists on my machine. I do not see any way
    to assign it a password so I can use it as the root
    account for mysql. (I had to install as machine root
    to be able to log in with 'mysql -u root -p' and
    then respond with the password.
    The mysql user on OS X doesn't have a password: it's not a login user or has no shell. I'm not sure of the technical details, but basically, you don't deal with OS X's mysql user like a regular user.
    It seems that the /usr/local/mysql directory should
    belong to mysql user instead of root.
    I think the only directory that has to belong to mysql is the data directory one level down from there:
    <pre class="command">-rw-r--r-- 1 root wheel 19071 Jul 19 09:10 COPYING
    -rw-r--r-- 1 root wheel 5712 Jul 19 09:25 EXCEPTIONS-CLIENT
    -rw-r--r-- 1 root wheel 8117 Jul 19 09:25 INSTALL-BINARY
    -rw-r--r-- 1 root wheel 1380 Jul 19 09:10 README
    drwxr-xr-x 69 root wheel 2346 Nov 7 19:59 bin
    -rwxr-xr-x 1 root wheel 801 Jul 19 09:33 configure
    drwxr-x--- 21 mysql wheel 714 Nov 14 12:37 data
    drwxr-xr-x 4 root wheel 136 Jul 19 09:33 docs
    drwxr-xr-x 62 root wheel 2108 Jul 19 09:33 include
    drwxr-xr-x 13 root wheel 442 Jul 19 09:33 lib
    drwxr-xr-x 3 root wheel 102 Jul 19 09:33 man
    drwxr-xr-x 13 root wheel 442 Jul 19 09:33 mysql-test
    drwxr-xr-x 3 root wheel 102 Jul 19 09:33 scripts
    drwxr-xr-x 5 root wheel 170 Jul 19 09:33 share
    drwxr-xr-x 31 root wheel 1054 Jul 19 09:33 sql-bench
    drwxr-xr-x 14 root wheel 476 Jul 19 09:33 support-files
    drwxr-xr-x 21 root wheel 714 Jul 19 09:33 tests</pre>
    Anyway, I do not see any way to use netinfo to set
    mysql's password.
    You use either mysqladmin or the mysql command line program (or some other program).
    Also, one big gap in the documentation on the Apple
    and MySQL web sites is that there is NO DISTINCTION
    between the machine's root user and MySQL's root
    user. Maybe there is none but that doesn't seem
    right to this neophyte.
    You're sort of right: that's not right. OS X has its users and MySQL has a completely different set of users. The MySQL root user has nothing to do with the OS X root user. And you can have dozens of users in MySQL without corresponding users in the OS. And none of them have to share passwords. Look at this page for more on granting users permissions in MySQL databases.
    I'm sure you'll have questions, so post back if some of that doesn't make sense...
    charlie

  • MySQL User account

    I'm trying to create a user account for MySQL. When I type in the Short Name "mysql" I get an error message "Name is used by another user". I don't know who or where this is being used. I'm trying to create a virtual directory to install and test an eCommerce site on my local hardrive.

    mountain gal
    Welcome to Apple Discussions!!
    When I type in the Short Name "mysql" I get an error message "Name is used by another user".That is correct. OS X by default installs a mysql user, with UID 74, and "real name" "MySQL Server".
    Note, you cannot log in as this user (no Home directory, no "shell").
    Not having set up MySQL myself, there's not much more I can add. But if you post your question again in the UNIX forum, I'm sure you'll get good advice there.

  • Mysql user problems [solved]

    hey, i have a problem with my mysql, when i try to login from shell, every account works, but when i try to login via php, it just says
    Could not connect: Access denied for user 'root'@'localhost' (using password: NO)
    but i dont even try to login with root, i tried multiple accounts and this is what i get all time...
    Last edited by nst (2009-01-22 18:01:55)

    yeah, i have
    extension=mysql.so uncommented
    mysqlMySQL Support enabled
    Active Persistent Links 0
    Active Links 0
    Client API version 5.0.75
    MYSQL_MODULE_TYPE external
    MYSQL_SOCKET /tmp/mysql.sock
    MYSQL_INCLUDE -I/usr/include/mysql
    MYSQL_LIBS -L/usr/lib -lmysqlclient
    Directive Local Value Master Value
    mysql.allow_persistent On On
    mysql.connect_timeout 60 60
    mysql.default_host no value no value
    mysql.default_password no value no value
    mysql.default_port no value no value
    mysql.default_socket no value no value
    mysql.default_user no value no value
    mysql.max_links Unlimited Unlimited
    mysql.max_persistent Unlimited Unlimited
    mysql.trace_mode Off Off
    this is from phpinfo, as you can see, the module works properly afaik.
    now i got rid of it, but i keep getting another error:
    Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 111
    its kinda funny now, after the 24 hours im installing and configuring this server )

  • Need some help from the smart apple users hehe

    Ok so i had to reformat my pc due to having a nasty virus.
    So the thing is that i have some music/photos on my ipod touch 3rd gen 32 gig that i dont want to lose.
    When i login to itunes the only option i see is to import the library to my ipod but that would delete all the files i do not wish to lose.
    How do i export all the contents of my ipod to the library?
    Thanks in advance for all the help.

    Have a look at this post by Zevoneer http://discussions.apple.com/thread.jspa?threadID=2013615&tstart=0
    After you manage to do what you want, don't forget to include your iTunes library in your backup routine http://support.apple.com/kb/HT1751 or http://support.apple.com/kb/HT1382

  • MySQL doesn't start[solved]

    I can't get the MySQL server to start.
    I have followed the wiki entry and fixed all the permissions and the ownership.
    Here is the error log
    lovelock# mysqld_safe
    111209 17:28:19 mysqld_safe Logging to '/var/lib/mysql/lovelock.err'.
    111209 17:28:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    111209 17:28:19 mysqld_safe mysqld from pid file /var/lib/mysql/lovelock.pid ended
    lovelock# cat /var/lib/mysql/lovelock.err
    111209 17:28:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld: Table 'mysql.plugin' doesn't exist
    111209 17:28:19 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    111209 17:28:19 InnoDB: The InnoDB memory heap is disabled
    111209 17:28:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    111209 17:28:19 InnoDB: Compressed tables use zlib 1.2.5
    111209 17:28:19 InnoDB: Initializing buffer pool, size = 128.0M
    111209 17:28:19 InnoDB: Completed initialization of buffer pool
    111209 17:28:19 InnoDB: highest supported file format is Barracuda.
    InnoDB: Log scan progressed past the checkpoint lsn 49439
    111209 17:28:19 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...
    InnoDB: Doing recovery: scanned up to log sequence number 1595675
    111209 17:28:19 InnoDB: Assertion failure in thread 140574630565664 in file fsp0fsp.c line 2101
    InnoDB: Failing assertion: inode
    InnoDB: We intentionally generate a memory trap.
    InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
    InnoDB: If you get repeated assertion failures or crashes, even
    InnoDB: immediately after the mysqld startup, there may be
    InnoDB: corruption in the InnoDB tablespace. Please refer to
    InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
    InnoDB: about forcing recovery.
    111209 17:28:19 - mysqld got signal 6 ;
    This could be because you hit a bug. It is also possible that this binary
    or one of the libraries it was linked against is corrupt, improperly built,
    or misconfigured. This error can also be caused by malfunctioning hardware.
    We will try our best to scrape up some info that will hopefully help diagnose
    the problem, but since we have already crashed, something is definitely wrong
    and this may fail.
    key_buffer_size=16777216
    read_buffer_size=262144
    max_used_connections=0
    max_threads=151
    thread_count=0
    connection_count=0
    It is possible that mysqld could use up to
    key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 134067 K
    bytes of memory
    Hope that's ok; if not, decrease some variables in the equation.
    Thread pointer: 0x0
    Attempting backtrace. You can use the following information to find out
    where mysqld died. If you see no messages after this, something went
    terribly wrong...
    stack_bottom = (nil) thread_stack 0x40000
    /usr/bin/mysqld(my_print_stacktrace+0x2e)[0x7882ae]
    /usr/bin/mysqld(handle_segfault+0x480)[0x516260]
    /lib/libpthread.so.0(+0xf850)[0x7fda1469d850]
    /lib/libc.so.6(gsignal+0x35)[0x7fda13362965]
    /lib/libc.so.6(abort+0x17b)[0x7fda13363ddb]
    /usr/bin/mysqld[0x506140]
    /usr/bin/mysqld[0x8599af]
    /usr/bin/mysqld[0x8671f8]
    /usr/bin/mysqld[0x82adc9]
    /usr/bin/mysqld[0x7d511c]
    /usr/bin/mysqld[0x7a2bd7]
    /usr/bin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x41)[0x66e171]
    /usr/bin/mysqld[0x58ff24]
    /usr/bin/mysqld(_Z11plugin_initPiPPci+0xc18)[0x595278]
    /usr/bin/mysqld[0x51b017]
    /usr/bin/mysqld(_Z11mysqld_mainiPPc+0x46d)[0x51e51d]
    /lib/libc.so.6(__libc_start_main+0xed)[0x7fda1334f17d]
    /usr/bin/mysqld[0x514a79]
    The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
    information that should help you find out what is causing the crash.
    111209 17:28:19 mysqld_safe mysqld from pid file /var/lib/mysql/lovelock.pid ended
    How do I fix this?
    Last edited by nikbhardwaj (2011-12-10 08:32:35)

    I have also tried uninstalling and re-installing to no avail.
    lovelock# pacman -Rdd mysql
    Remove (1): mysql-5.5.18-1
    Total Removed Size: 77.83 MB
    Do you want to remove these packages? [Y/n] y
    (1/1) removing mysql [#####################################################] 100%
    warning: /etc/mysql/my.cnf saved as /etc/mysql/my.cnf.pacsave
    lovelock# pacman -S mysql
    resolving dependencies...
    looking for inter-conflicts...
    Targets (1): mysql-5.5.18-1
    Total Download Size: 0.00 MB
    Total Installed Size: 77.83 MB
    Proceed with installation? [Y/n] y
    (1/1) checking package integrity [#####################################################] 100%
    (1/1) checking for file conflicts [#####################################################] 100%
    (1/1) installing mysql [#####################################################] 100%
    Installing MySQL system tables...
    OK
    Filling help tables...
    OK
    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system
    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    /usr/bin/mysqladmin -u root password 'new-password'
    /usr/bin/mysqladmin -u root -h lovelock password 'new-password'
    Alternatively you can run:
    /usr/bin/mysql_secure_installation
    which will also give you the option of removing the test
    databases and anonymous user created by default. This is
    strongly recommended for production servers.
    See the manual for more instructions.
    You can start the MySQL daemon with:
    cd /usr ; /usr/bin/mysqld_safe &
    You can test the MySQL daemon with mysql-test-run.pl
    cd /usr/mysql-test ; perl mysql-test-run.pl
    Please report any problems with the /usr/scripts/mysqlbug script!
    Optional dependencies for mysql
    perl-dbi
    perl-dbd-mysql

  • Mediawiki, mysql, php? problems [SOLVED]

    On Sunday my Arch install that is hosted by Slicehost became unresponsive to them so they had to do an emergency reboot. After it came back up my install of mediawiki was (and still is) only returning a blank page (at least in Firefox). After some digging I found out that part of the problem was that mysqld wasn't starting so I managed to get that fixed by commenting out the lines relating to innodb and putting in skip-innodb into my.cnf. But I'm still getting a blank page.
    According to Mediawiki's manual, "A blank white page indicates a PHP error which isn't being printed to the screen." They give two lines to put into LocalSettings.php to force error messages but after doing that I'm still getting a blank page. Changing display_errors in php.ini to ON didn't have any effect.  When I load the wiki in Safari I get the following error: "Got java.io.EOFException (Server closed connection while sending the HTTP header.): http://some_url.com/mediawiki/index.php/Main_Page". I have no idea what this error means and googling java.io.EOFException doesn't bring up anything very helpful. My PHP Test Page indicates that PHP is up and running.
    Any ideas on fixes or where I can find more clues?
    [EDIT]
    Mysql was definitely the root of the problems with Mediawiki. I tried nearly every suggestion listed in the forums for fixing a mysql install that wouldn't start but nothing worked. I even completely uninstalled mysql and reinstalled it but it still refused to start. I switched over to postgresql and switched mediawiki to run with that. Problem solved.
    Last edited by k_odoma (2009-05-23 01:48:35)

    There are some other things that must be done to connect to
    the database
    (such as passing the usernamee, password, and host info to
    mysql_connect()
    and storing the connection resource), and those might be in
    the include
    files. I generally place all of the connection parameters in
    a separate file
    that is located in a folder that can't be accessed by a
    browser, for
    security purposes.
    Paul Swanson
    Portland, Oregon, USA
    "Amy Blankenship *AdobeCommunityExpert*"
    <[email protected]>
    wrote in message news:edk6ui$69c$[email protected]..
    > What's in the include(s)?
    >
    > "83Dons" <[email protected]> wrote in
    message
    > news:edk5s5$4uk$[email protected]..
    > > Here is the php code for the 'read' and 'write'
    parts:
    > >
    > >
    > >
    > > <?php
    > > include '......';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $sql = "select A1Answer from authorware where id =
    '13'";
    > > $result = mysql_query($sql);
    > > $answer1 = mysql_result($result,0,"A1Answer");
    > > print $answer1;
    > > ?>
    > >
    > > <?php
    > > include '............';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $newdata = $_GET['data'];
    > > mysql_query("insert into authorware (A1Answer)
    values('$newdata')")
    or
    > > die(mysql_error());
    > > mysql_close(); ?>
    > >
    >
    >

  • JSP-MySQL user login with username, password and registration

    Hi everyone:
    i need to create a simple jsp client login with username and password. There is also a registration link for those not register yet.
    I m using tomcat and MySQL and have already create a client login with username and password page.(record already in database).
    I m now have no idea on how to create a registration link, ie update the database. please help..the examples i search through google were build by Jboss, strut, ApacheGeronimo which i m not familiar with.
    Is it any "package" or "wizard" available in creating the login and registration page? Most of the webpage has build with user login and registration part, may i know how they "create" them?
    Please help.. Thanks in advance!

    hi,
    You can use tomcat5.5 for this. you can get help from the following link.
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    If ur registrantion page is RegistrationPage.jsp then u can write it:
    <a href="RegistrationPage.jsp">Registration Page </a">For Registration page u have to use session & for u can search this in javaworld.com site. MAy from this u will get ur solution

  • JDeveloper install is machine-based, not user-based ! [Solved]

    Hi,
    I am in a Windows 2003 domain development setup where several users can share the same computer to develop. From my understanding, JDeveloper install and settings handling is machine-based, not user-based ! This is quite a problem because if a user changes of computer to develop, he will lose his JDev settings. How can I solve this, by saving the user settings to a remote folder ?
    Thanks
    EDIT: I solved this problem by adding a JDEV_USER_HOME environment variable pointing to a shared folder.
    Message was edited by:
    Alexandre Abric

    Hi,
    I am in a Windows 2003 domain development setup where several users can share the same computer to develop. From my understanding, JDeveloper install and settings handling is machine-based, not user-based ! This is quite a problem because if a user changes of computer to develop, he will lose his JDev settings. How can I solve this, by saving the user settings to a remote folder ?
    Thanks
    EDIT: I solved this problem by adding a JDEV_USER_HOME environment variable pointing to a shared folder.
    Message was edited by:
    Alexandre Abric

  • Good Oracle DB book for MySQL users?

    I'm new to Oracle. I have a good amount of experience with MySQL. I was wondering if there is a book written as an introduction to Oracle for people already familiar with MySQL.

    Hi,
    The best place to start is at the Oracle documentation site -
    http://www.oracle.com/technology/documentation/index.html
    and from there choose the 'DBAs' tab under 'Getting Started' and this has pointers to basic information.
    Regards,
    Mike

  • MySQL - how can I change an IP address restriction for a user [solved]

    I'm getting "Host ... is not allowed to connect to this MySQL server" when attempting to connect to mysql.  I read this guide which gives a solution but I have no idea how to physically implement the solution.
    You can fix this by setting up an account for the combination of client host name and user name that you are using when trying to connect.
    I want to change the access from "localhost" to any address on my LAN (192.168.0.*) for user facade, but am unsure of the proper syntax.
    # mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 53
    Server version: 5.5.16-log Source distribution
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    mysql> select host, user from mysql.user;
    +-----------+--------+
    | host | user |
    +-----------+--------+
    | 127.0.0.1 | root |
    | ::1 | root |
    | localhost | facade |
    | localhost | root |
    +-----------+--------+
    4 rows in set (0.00 sec)
    Last edited by graysky (2011-10-18 23:37:54)

    Host can be a combination of IP/netmask. In your case, something like:
    UPDATE mysql.user SET host = '192.168.0.0/255.255.255.0' WHERE user = 'facade'

  • [solved] mysql suddenly access denied for user root ..

    Hi folk,
    I am in total panic right now!
    As of an hour ago i suddenly got 'Error establishing a database connection' from all of my sites
    I then first tried to login through phpmyadmin but got #1045 Cannot log in to the MySQL server
    I then tried to login through the terminal but got ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    I am not really sure where to find solutions because primarily this error is on new installs:
    I have tried the following :
    mysql_safe --skip-grant-tables
    [odp@odp ~]$ sudo mysqld_safe --skip-grant-tables &
    [4] 3181
    [odp@odp ~]$ 140115 19:43:50 mysqld_safe Logging to '/var/lib/mysql/odp.err'.
    140115 19:43:50 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    140115 19:43:52 mysqld_safe mysqld from pid file /var/lib/mysql/odp.pid ended
    [4] Done sudo mysqld_safe --skip-grant-tables
    here is the odp.err
    140115 19:25:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    140115 19:25:41 InnoDB: The InnoDB memory heap is disabled
    140115 19:25:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    140115 19:25:41 InnoDB: Compressed tables use zlib 1.2.8
    140115 19:25:41 InnoDB: Using Linux native AIO
    140115 19:25:41 InnoDB: Initializing buffer pool, size = 128.0M
    140115 19:25:41 InnoDB: Completed initialization of buffer pool
    140115 19:25:41 InnoDB: highest supported file format is Barracuda.
    140115 19:25:41 InnoDB: Waiting for the background threads to start
    140115 19:25:42 Percona XtraDB (http://www.percona.com) 5.5.34-MariaDB-31.1 started; log sequence number 38562281
    140115 19:25:42 [Note] Plugin 'FEEDBACK' is disabled.
    140115 19:25:42 [ERROR] /usr/bin/mysqld: unknown option '--skip-grant-tables'
    140115 19:25:42 [ERROR] Aborting
    140115 19:25:42 InnoDB: Starting shutdown...
    140115 19:25:42 InnoDB: Shutdown completed; log sequence number 38562281
    140115 19:25:42 [Note] /usr/bin/mysqld: Shutdown complete
    140115 19:25:42 mysqld_safe mysqld from pid file /var/lib/mysql/odp.pid ended
    140115 19:35:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    140115 19:35:48 InnoDB: The InnoDB memory heap is disabled
    140115 19:35:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    140115 19:35:48 InnoDB: Compressed tables use zlib 1.2.8
    140115 19:35:48 InnoDB: Using Linux native AIO
    140115 19:35:48 InnoDB: Initializing buffer pool, size = 128.0M
    140115 19:35:48 InnoDB: Completed initialization of buffer pool
    InnoDB: Unable to lock ./ibdata1, error: 11
    InnoDB: Check that you do not already have another mysqld process
    InnoDB: using the same InnoDB data or log files.
    140115 19:35:48 InnoDB: Retrying to lock the first data file
    InnoDB: Unable to lock ./ibdata1, error: 11
    InnoDB: Check that you do not already have another mysqld process
    InnoDB: using the same InnoDB data or log files.
    140115 19:37:28 InnoDB: Unable to open the first data file
    InnoDB: Error in opening ./ibdata1
    140115 19:37:28 InnoDB: Operating system error number 11 in a file operation.
    InnoDB: Error number 11 means 'Resource temporarily unavailable'.
    InnoDB: Some operating system error numbers are described at
    InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
    140115 19:37:28 InnoDB: Could not open or create data files.
    140115 19:37:28 InnoDB: If you tried to add new data files, and it failed here,
    140115 19:37:28 InnoDB: you should now edit innodb_data_file_path in my.cnf back
    140115 19:37:28 InnoDB: to what it was, and remove the new ibdata files InnoDB created
    140115 19:37:28 InnoDB: in this failed attempt. InnoDB only wrote those files full of
    140115 19:37:28 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
    140115 19:37:28 InnoDB: remove old data files which contain your precious data!
    140115 19:37:28 [ERROR] Plugin 'InnoDB' init function returned error.
    140115 19:37:28 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    140115 19:37:28 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
    I have also tried the solution where you move the ibdata1 and copy it back with -a to no success.
    The result of mysqld_safe --skip-grant-tabels
    [odp@odp ~]$ mysqld_safe --skip-grant-tabels &
    [4] 3555
    [odp@odp ~]$ 140115 19:49:21 mysqld_safe Logging to '/var/lib/mysql/odp.err'.
    touch: cannot touch '/var/lib/mysql/odp.err': Permission denied
    chmod: cannot access '/var/lib/mysql/odp.err': Permission denied
    140115 19:49:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    /usr/bin/mysqld_safe: line 138: /var/lib/mysql/odp.err: Permission denied
    rm: cannot remove '/var/lib/mysql/odp.pid': Permission denied
    /usr/bin/mysqld_safe: line 182: /var/lib/mysql/odp.err: Permission denied
    touch: cannot touch '/var/lib/mysql/odp.err': Permission denied
    chown: cannot access '/var/lib/mysql/odp.err': Permission denied
    chmod: cannot access '/var/lib/mysql/odp.err': Permission denied
    140115 19:49:21 mysqld_safe mysqld from pid file /var/lib/mysql/odp.pid ended
    /usr/bin/mysqld_safe: line 138: /var/lib/mysql/odp.err: Permission denied
    [4] Exit 1 mysqld_safe --skip-grant-tables
    any advice is greatly appreciated
    Last edited by odp (2014-01-15 19:46:39)

    OK super random, it works now.
    First off I too took and added skip-grant-tables to [mysqld] /etc/mysql/my.cnf
    restarted mysqld and finally had passwordless login. From within mysql i ran
    UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
    FLUSH PRIVILEGES;

  • Php/mysql: can't write to mysql database [SOLVED]

    I'm writing a login script using php and mysql. I got it to work on my server about a week ago, and then I set up apache, php and mysql on my netbook so that I could take my code with me and test it. Now it doesn't work. My registration script doesn't write to the mysql database but has no errors. Here is register.php:
    <?php
    define("DB_SERVER", "localhost");
    define("DB_USER", "root");
    define("DB_PASS", "swordfish");
    define("DB_NAME", "users");
    define("TBL_USERS", "users");
    $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
    mysql_select_db(DB_NAME, $connection) or die(mysql_error());
    function addUser($username, $password)
    global $connection;
    $password = md5($password);
    echo("adding $username,$password<br />");
    $q = "INSERT INTO " . TBL_USERS . " VALUES ('$username', '$password')";
    echo("query: $q<br />");
    $result = mysql_query($q, $connection);
    echo("$result<br />");
    if (isset($_POST["reg"]))
    addUser($_POST["username"], $_POST["password"]);
    echo("<a href='index.php'>click here to login</a>");
    ?>
    <html>
    <head>
    <title>Register</title>
    </head>
    <body>
    <form method="Post" name="login">
    <input type="text", name="username" /> Username<br />
    <input type="text", name="password" /> Password<br />
    <input type="submit" name="reg", value="Register" />
    </form>
    </body>
    </html>
    and here is the output (without the form):
    adding lexion,6f1ed002ab5595859014ebf0951522d9
    query: INSERT INTO users VALUES ('lexion', '6f1ed002ab5595859014ebf0951522d9')
    Also, I tried manually adding the content to the database:
    $ mysql -p -u root
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 9
    Server version 5.1.42 Source distribution
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    mysql> users
    -> INSERT INTO users VALUES('lexion', 'foo')
    -> ^D
    -> Bye
    I would assume that I got something wrong with the last bit, but the php script seems like it should work. Does anybody know why it doesn't?
    Last edited by Lexion (2010-01-10 19:04:15)

    What is wrong with your PHP? Why do you think it is failing? An INSERT query doesn't return anything. Also, it's a good idea to specify which fields you are inserting into, unless you want to have to provide something for every field (tedious for tables with many fields with default values). eg:
    $q = "INSERT INTO `" . TBL_USERS . "`(`username`, `password`) VALUES ('$username', '$password')";
    As for your experiment with the mysql prompt; queries have to end with a semicolon. PHP is nice and hides that little detail from you.
    edit: Also, you're echoing text out before the HTML starts. That won't produce valid HTML. I also noticed a few other things which I corrected; look at my comments:
    <?php
    define("DB_SERVER", "localhost");
    define("DB_USER", "root");
    define("DB_PASS", "swordfish");
    define("DB_NAME", "users");
    define("TBL_USERS", "users");
    $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
    mysql_select_db(DB_NAME, $connection) or die(mysql_error());
    function addUser($username, $password)
    global $connection;
    $password = md5($password);
    // echo("adding $username,$password<br />"); - Don't echo stuff before HTML starts.
    // Also, clean up user-supplied data before plugging it into a query unless you want to be vulnerable to SQL injection.
    $cleanusername = mysql_real_escape_string($username, $connection);
    $cleanpassword = mysql_real_escape_string($password, $connection); // Obviously you'd generally use some hashing algorithm like md5 or sha1 for passwords
    $q = "INSERT INTO `" . TBL_USERS . "`(`username`, `password`) VALUES ('{$cleanusername}', '{$cleanpassword}')"; // The backticks tell MySQL not to interpret any text within as a keyword (good for field names, eg a field called `date`. The curly brackets tell PHP that the stuff within refers to a variable; it's nice as PHP knows exactly what the variable name is with no possible ambiguity.
    // echo("query: $q<br />");
    $result = mysql_query($q, $connection);
    // echo("$result<br />"); - This won't do anything; in addition to INSERT queries not returning anything, the $result variable doesn't contain the results of the query, it's a pointer to them for use with mysql_result().
    ?>
    <html>
    <head>
    <title>Register</title>
    </head>
    <body>
    <?php
    if (isset($_POST["reg"]))
    addUser($_POST["username"], $_POST["password"]);
    echo("<a href='index.php'>click here to login</a>");
    ?>
    <form method="Post" name="login">
    <input type="text" name="username" /> Username<br />
    <input type="text" name="password" /> Password<br />
    <input type="submit" name="reg" value="Register" />
    </form>
    </body>
    </html>
    <?php
    mysql_close($connection); // Not strictly needed, as PHP will tidy up for you if you forget.
    ?>
    Last edited by Barrucadu (2010-01-10 17:34:20)

  • Problem with MySQL (SOLVED)

    Hello everybody. I have a problem with my MySQL server. Just installed it, ant when i try to start it:
    [root@localhost html]# /etc/rc.d/mysqld start
    :: Adding mysql group [DONE]
    :: Adding mysql user [DONE]
    Installing MySQL system tables...
    ERROR: 1062 Duplicate entry 'localhost-' for key 1
    071223 22:35:05 [ERROR] Aborting
    071223 22:35:05 [Note] /usr/sbin/mysqld: Shutdown complete
    Installation of system tables failed!
    I tryed to search some info in google, havent found anything.
    Does anybody has some ideas?
    Last edited by neXTPeer (2007-12-23 08:38:09)

    I have a huge problem, it seems I can't login to my own mysql server
    mysql -u root -p
    Enter password:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    The first time I started mysqld I got the same error as above. The script that should create an account stopped. Because of this I didn't set a root password. I think I never set a root password, but somehow mysqld expects one.
    Could someone help?
    btw: my host in rc.conf is not localhost and it's corresponding with the hostname in /etc/hosts
    -edit--
    I just tried these steps: http://dev.mysql.com/doc/refman/5.0/en/ … sions-unix
    But this also didn't work
    --edit2--
    Seems that there isn't a root account at all!
    Last edited by Vrieskist (2008-02-07 02:21:24)

  • [SOLVED]Cannot install mysql correctly

    Hi
    If i try install mysql I get this errror:
    chown: invalid user: 'mysql'
    Cannot change ownership of the database directories to the 'mysql'
    user. Check that you have the necessary permissions and try again.
    error: command failed to execute correctly
    Optional dependencies for mysql
    perl-dbi
    perl-dbd-mysql
    Do i have to user called "mysql"? How can I install this package correctly?
    Last edited by xorgx3 (2012-05-28 10:21:02)

    What happens if you try to start the daemon after fixing the permissions (/etc/rc.d/mysqld start). Also check the mysql logs in /var/log should it fail.
    If I try running daemon after fixing permissions still I see
    /etc/rc.d/mysqld start
    :: Starting MySQL Server [BUSY]
    [FAIL]
    Do you get this?
    % grep mysql /etc/passwd
    mysql:x:89:89::/var/lib/mysql:/bin/false
    If not, try adding that line.
    Where I have to add that line?
    grep not shows anything.
    Last edited by xorgx3 (2012-05-26 14:43:33)

Maybe you are looking for

  • Problem with Itunes program

    Recently, my itunes simply will not open from any of the prgram location on my computer. If tried deleting the program and redownloading it but it still will not open. Also when I do click on the icon and then search to see if its operating the compu

  • IPhoto, iWeb & shared library

    Hi, Is it possible to have a (home) network with a multi & full accessed read/write iPhoto library? I've an old PowerPC MacMini primarily used (like a NAS) as a central storage device. It contains my music, photo libraries etc which are further store

  • VL02N PGI ERROR

    Hi experts, After I created the outbound delivery,I dong PGI,the following error pop! Delivery has not yet been put away / picked(completely) I don't know where si the problem. Anyone have a clue how to force it out? tks a million. david.

  • I'm trying to install photoshop CC because I just purchased a license, but it doesn't work via creative cloud.  " error " message,  and now I'm stuck.

    I just purchased a license for photoshop CC because my older version of CS5 is expired. but I can't seem to download it via creative cloud, it says error all the time. and it's like 40 procent downloaded. What can I do?

  • Recently Added folder gone?

    I accidentally deleted the Recently Added folder. How do I get it back? Hopefully I don't need to reinstall the entire iTunes program? ibook G3   Mac OS X (10.3.9)