LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mandrake 9.2 - Mysql access (https://www.linuxquestions.org/questions/linux-newbie-8/mandrake-9-2-mysql-access-131484/)

bobmac 01-04-2004 03:12 PM

Mandrake 9.2 - Mysql access
 
I am totally new to Linux, have read as much as I can take in from the manuals.

As part of the Mandrake 9.2 disks there is an SQL db named Mysql which I have installed? via the control centre. I have read what I think I understand from the MYsql manual but, do admit that much of what I read is gobbledygook. Talk of glib's and -this and -that, I'm afraid is meaningless.

When I attempt to access MYsql, however, I get all sorts of error messages. I have left messages elsewhere and received answers which mainly seem to be associated with security. Most of them talk about changing permissions but nobody seems to want to say what permissions, to what files and, or, users these permissions relate.

The main messages seem to be about the system being unable to open a *****.sock located at /var/lib/... or a message that ends with (111).

I have figured out how to check the status and how to start and stop mysql, but whenever I enter
mysql -h Linux -u bob -p
Password: (password entered) I get these messages.

I have tried all sorts of combinations wrt to the switches to no avail.

I should point out that the box named Linux is on a network that has no domain. The other machines are a Windows 2000 pro and an XP machine. The Linux box can communicate with the other machines with no problem.

I understand that this is perhaps a bit vague but, as mentioned at the start of this message, I'm totally new to Linux. I do, however, have a Microsoft MCSE, have, on numerous occasions installed Windows (various versions) and, or, Small Business Servers including SQL with no problem whatsoever. I say this just so that it may be understood that I don't think that I'm a complete idiot (although I do feel like one when I cannot get something like this, that would appear to be straight forward, to work).

I would be grateful I anyone can shed some light on my problem

bob

bobmac@netspacexxx.net.au - if answering directly please remove the xxx.

then 01-04-2004 04:21 PM

Re: Mandrake 9.2 - Mysql access
 
Quote:

Originally posted by bobmac
When I attempt to access MYsql, however, I get all sorts of error messages. I have left messages elsewhere and received answers which mainly seem to be associated with security. Most of them talk about changing permissions but nobody seems to want to say what permissions, to what files and, or, users these permissions relate.

The main messages seem to be about the system being unable to open a *****.sock located at /var/lib/... or a message that ends with (111).

I have figured out how to check the status and how to start and stop mysql, but whenever I enter
mysql -h Linux -u bob -p
Password: (password entered) I get these messages.

Let me get this straight -
you're able to start the server; *do* have a .sock file; but aren't able to connect to the server?

is the above understanding of your situation correct?

regards
akr

bobmac 01-04-2004 04:25 PM

I'm not at my machine at present, however, the message about the .sock seems to indicate that the system can't locate it or it doesn't exist.

tommytomato 01-04-2004 10:15 PM

If your trying to access mysql via the CLI, try using no password just hit enter button.

mysql -h Linux -u bob -p
Password: hit enter

Thats how i got into mine once..

Did you Remember to set a pasword for the MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost password 'new-password'

here is how i did mine if its any help

Quote:

[root@localhost bin]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 3.23.58

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.01 sec)

mysql>
Quote:

Adding a password for mysql

[root@localhost root]# cd /usr/bin
[root@localhost bin]# mysqladmin -u root password 'your_password'
[root@localhost bin]#
TT:study:

then 01-05-2004 01:38 AM

Quote:

Originally posted by bobmac
I'm not at my machine at present, however, the message about the .sock seems to indicate that the system can't locate it or it doesn't exist.
Two entirely different situations! please find out which.

Check my.cnf (mysql-server config file) for where its expected to create the .sock file. Then check if mysqld has the write permission to that directory.

regards
akr

bobmac 01-06-2004 03:59 AM

Please forgive my stupidity, as I said at the start of this question I'm completely new to Linux so I suppose that my questions are pretty daft. However,

Searched for my.cnf. It doesn't seem to exist, however, in /usr/share/mysql I have found several similar files - my-huge.cnf, my-large-cnf, my-medium.cnf and my-small.cnf

Apart from the comments about memory size, they all seem to have similar data, which is;

[root@Linux mysql]# cat my-huge.cnf
# Example mysql config file for very large systems.
#
# This is for large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# One can in this file use all long options that the program supports.
# If you want to know which options a program support, run the program
# with --help option.

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin

# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 384M
#bdb_max_lock = 100000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 100M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

I have no idea what I'm supposed to do next

regards,

Bob


All times are GMT -5. The time now is 11:47 PM.