Jump to content


- - - - -

mySQL Database on Ubuntu


  • Please log in to reply
2 replies to this topic

#1 wildweaselmi

wildweaselmi

    Administrator

  • Administrators
  • 1,024 posts

Posted 07 April 2011 - 10:24 PM

To Create Mysql user


mysql_install_db
mysqladmin -u root password YOURPASS mysql -u root -p
Password: YOUR PASS
mysql>create database DBNAME;
mysql>\q




TO import
mysql torrentflux < omggggg.sql -u root -p
Password: YOUR PASS



#2 shadowmac

shadowmac

    Member

  • Members
  • PipPipPip
  • 93 posts

Posted 07 April 2011 - 10:26 PM

This is what works for me

sudo apt-get install mysql-server
sudo /etc/init.d/mysql start
mysqladmin -u root -p create mydatabase


#3 djzah

djzah

    Junior Member

  • Members
  • 1,202 posts

Posted 07 April 2011 - 10:35 PM

I saw this post and I figured I would add my two cents.  Here is a snippet of what I use to create the pureftp database from command line in mysql on my ubuntu box

Create a database called pureftpd and a MySQL user named pureftpd which the PureFTPd daemon will use later on to connect to the pureftpd database:

mysql -u root -p

CREATE DATABASE pureftpd;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO 'pureftpd'@'localhost' IDENTIFIED BY '[b]ftpdpass[/b]';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO 'pureftpd'@'localhost.localdomain' IDENTIFIED BY '[b]ftpdpass[/b]';
FLUSH PRIVILEGES;

Replace the string ftpdpass with whatever password you want to use for the MySQL user pureftpd. Still on the MySQL shell, we create the database table we need (yes, there is only one table!):

USE pureftpd;

CREATE TABLE ftpd (
User varchar(16) NOT NULL default '',
status enum('0','1') NOT NULL default '0',
Password varchar(64) NOT NULL default '',
Uid varchar(11) NOT NULL default '-1',
Gid varchar(11) NOT NULL default '-1',
Dir varchar(128) NOT NULL default '',
ULBandwidth smallint(5) NOT NULL default '0',
DLBandwidth smallint(5) NOT NULL default '0',
comment tinytext NOT NULL,
ipaccess varchar(15) NOT NULL default '*',
QuotaSize smallint(5) NOT NULL default '0',
QuotaFiles int(11) NOT NULL default 0,
PRIMARY KEY (User),
UNIQUE KEY User (User)
) TYPE=MyISAM;

quit;

As you may have noticed, with the quit; command we have left the MySQL shell and are back on the Linux shell.

BTW, (I'm assuming that the hostname of your ftp server system is server1.example.com) you can access phpMyAdmin under http://server1.example.com/phpMyAdmin/ (you can also use the IP address instead of server1.example.com) in a browser and log in as the user pureftpd. Then you can have a look at the database. Later on you can use phpMyAdmin to administrate your PureFTPd server.





Similar Topics Collapse

  Topic Forum Started By Stats Last Post Info

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users