LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL initial databases needed (https://www.linuxquestions.org/questions/linux-software-2/mysql-initial-databases-needed-928329/)

CollieJim 02-08-2012 11:02 AM

MySQL initial databases needed
 
I'm trying to get MySQL set up on a Buffalo LinkStation NAS box. It has a Debian variant I think.

MySQL is installed, but until I started trying to set it up it had never been started. I'm not having much luck.

I tried mysql_install_db. The only databases I got were information_schema and test. I suspect 'mysql' should be there too.

I cannot even change root's password.

How do I set up the initial database? I have yet to try uninstall and reinstall.

Thanks
Jim

ButterflyMelissa 02-08-2012 12:40 PM

There is no initial database in mySQL as such...the database is part of the package in use. In that case, the package needs to set up the base, you may need to look into the manual for this...or install the database of the package. In some cases (this is the way I install databases) there is an SQL script to run inside mySQL...

The root's password is not set initially, however, but, this easy howto should get that sorted out...

Luck

Thor

Harlin 02-08-2012 02:09 PM

I follow these steps on Linux variants (and Macs) that may not have a nice and easy create db inits when I install MySQL server:

* mysql_install_db
*<mysql_install>/bin/mysqld_safe &
*mysql -u root
from mysql cli:
grant all privileges on *.* to 'root'@'localhost' identified by 'root_password';

These work for me but I would not rely only on this if you're setting it up for a production instance. There's a few more things to consider for that. This should get you up and running.

</H>

CollieJim 02-09-2012 07:24 AM

Thor, this is what I get:
Code:

root@Nas:~# mysqladmin -u root password 'sometext';
mysqladmin: Can't turn off logging; error: 'Access denied; you need the SUPER privilege for this operation'
root@Nas:~#

The mysql_install_db script wants to create tables named db, host, user, func, tables_priv and about 13 more. None of these show up after it is run. Surely MySQL must have its own database to keep track of administrative stuff.

This is the current state of things after trying various things including those suggested above. Endless 'permission denied', 'access denied', or missing privilege. I cannot create a user or change password.
Code:

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

mysql> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------------------+
| Tables_in_information_schema          |
+---------------------------------------+
| CHARACTER_SETS                        |
| COLLATIONS                            |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS                              |
| COLUMN_PRIVILEGES                    |
| KEY_COLUMN_USAGE                      |
| ROUTINES                              |
| SCHEMATA                              |
| SCHEMA_PRIVILEGES                    |
| STATISTICS                            |
| TABLES                                |
| TABLE_CONSTRAINTS                    |
| TABLE_PRIVILEGES                      |
| TRIGGERS                              |
| USER_PRIVILEGES                      |
| VIEWS                                |
+---------------------------------------+
16 rows in set (0.00 sec)

mysql> select * from USER_PRIVILEGES;
+----------------+---------------+----------------+--------------+
| GRANTEE        | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+----------------+---------------+----------------+--------------+
| ''@'localhost' | NULL          | USAGE          | NO          |
+----------------+---------------+----------------+--------------+
1 row in set (0.00 sec)

mysql>


ButterflyMelissa 02-09-2012 09:12 AM

Mayne the tutorial at howtoforge (did help me...forgot about it or I would have posted it sooner) can help...

rhbegin 02-09-2012 02:53 PM

I would get rid of the 'test' database, run mysql_secure_installation would be good if it is a public facing server.

Plus, it gets rid of the anonymous users as well.


All times are GMT -5. The time now is 02:49 AM.