Tag Info

New answers tagged

1

If you want to replace \\ with \ with sed you just need to escape each of \, so for example: $ printf "%s\n" 'a\\b' a\\b $ printf "%s\n" 'a\\b' | sed 's/\\\\/\\/g' a\b But, frankly speaking it seems that in your case it would be better to correct mysql command, so I think this question is better suited to stackoverflow.com.


1

Depends on how you installed MySQL-python. If with "pip" no. If MySQL was installed you would have had to supply a user and password. I doubt you would forget either. Easiest method to check if MySQL is installed you will have a /etc/mysql/ directory. You can check the process list to check if MySQL is running with ps -ef | grep mysql. If it shows no ...


1

Sometimes you can clobber your configuration. As such, it's easier to start over, as if the package had never been installed. In your case, we are looking at MySQL. We use Yum to Remove MySQL, like so: yum remove mysql mysql-server With MySQL removed, we can safely backup the configuration: mv /var/lib/mysql /var/lib/mysql_old_backup If you'd rather ...


0

It is probably because the 'restart' is not killing the MySQL started in the sos mode by 'startsos' and port 3306 (or wherever it is running) is occupied. After the 4th step, please try these: $ sudo service mysqld stop $ ps -ef | grep mysql Now, from the output of ps, if you don't see any mysql processes running, then start MySQL using the below command. ...


0

If you can get into MySQL when using the command: mysql -u root Then you already have access to MySQL, you will either not have a password set for the "root" user (most likely) or you may have a password set in a configuration file for MySQL such as /etc/my.cnf. If you want to reset your MySQL root password then you should be able to run: $ ...


2

You can do something like this: #! bin/bash selectvar="SELECT * FROM test;" mysql --user=root --password=mypass database << eof $selectvar eof


1

To execute statements from the command line without an interactive prompt, use the -e option: mysql mydb -e 'select * from foo'


2

::1 is the ipv6 version of 127.0.0.1


1

The address ::1 (or 0000:0000:0000:0000:0000:0000:0000:0001 with all fields written out) is an IP version 6 address and specifies the loopback address in host scope. So technically, it is the same as the IP version 4 address 127.0.0.1.


0

You might want to look into Puppet - it is excellent for installing and configuring software automatically. There's also a MySQL module, but I haven't tried it.


0

It should be okay. Unlike the top command, htop by default lists all the threads along with the processes. So all the 'mysqld' that you are seeing are not processes, but threads. Do this: Grab the PID of a few mysql entries you see in the htop output and grep it in the output of ps. Eg: ps -ef | grep 14082 Here, the grep probably won't return any mysql ...


0

Usually an OS user-account mysql is created at installation time. This is the user that runs the mysql-daemon. Most packages that come with a daemon will create their own user-account to prevent interference or security issues between different packages. A user called mysql is not created automatically within the database.


1

I have very limited knowledge what mount --bind even does really, but I think I might have figured out why I'm facing this problem with /run/mysqld in particular. I've just noticed /run (previously /var/run) is a tmpfs and thus it gets emptied during a reboot. So my guess is that /run/mysqld doesn't exist when /etc/fstab gets parsed. It's the init-script ...


0

I don't know which OS platform & version you are using But TCP Wrappers can help Edit your /etc/hosts.allow file #first Allow all local connections ALL: 127.0.0.1 #allow ssh Access to IPs this is important as you need to allow some users to login via ssh sshd: 1.1.1.1 sshd: 2.2.2.2 #change above Ips to your need then only those will have ssh ...


0

Seeing no-one else is answering I will but to be fair Archemar worked it out before me. I knew I needed to select a table but was unsure of syntax and didn't consider making sure folder apache owned. To export mysql database table to CSV file you log in to admin then use following commands. SELECT * INTO OUTFILE '/tmp/products.csv' FIELDS TERMINATED BY ',' ...


0

Turns out that placing sudo in front of the mysql call fixed it and now the call runs correctly. I have no idea: Why the script is not run as root user. What user it is running as. Why that user has sudoer abilities.


0

When running a init.d, script unless you are explicitly sourcing in that .my.cnf in your init.d script, it will not be used. Kinda like crontab. So try sourcing it in and see if that works. On a different note, does this script have to log into the DB as root user? I understand why the OS level user needs to be root, but why such a privileged user in the DB ...



Top 50 recent answers are included