«

»

Print this Post

Dabr MySQL installation

Dabr requires no database for normal installation. But you need a database to store the “username”, “oauth_key”, “oauth_secret” and the password of an user. This post shows how to get into Dabr MySQL installation.

Use database wizard to create a database and an user (username). Grant all privileges for that user. Then, edit config.php and replace

1
2
3
define('MYSQL_USERS', 'OFF');
// mysql_connect('localhost', 'username', 'password');
// mysql_select_db('dabr');

with

1
2
3
define('MYSQL_USERS', 'ON');
 mysql_connect('localhost', 'username', 'password');
 mysql_select_db('dabr');

and fill the database name, database username and password.

Then remove commented part of the database creating code. i.e change

/* The following table is needed to store user login details if you enable MYSQL_USERS:
 
CREATE TABLE IF NOT EXISTS `user` (
  `username` varchar(64) NOT NULL,
  `oauth_key` varchar(128) NOT NULL,
  `oauth_secret` varchar(128) NOT NULL,
  `password` varchar(32) NOT NULL,
  PRIMARY KEY (`username`)
)
 
*/

to

CREATE TABLE IF NOT EXISTS `user` (
  `username` varchar(64) NOT NULL,
  `oauth_key` varchar(128) NOT NULL,
  `oauth_secret` varchar(128) NOT NULL,
  `password` varchar(32) NOT NULL,
  PRIMARY KEY (`username`)
)

If the Dabr doesn’t create database tables automatically, you’ve to create it manually with these fields,

Table name: ‘user’

Field Type Length/Values NULL Index
username VARCHAR 64 PRIMARY
oauth_key VARCHAR 128
oauth_secret VARCHAR 128
password VARCHAR 32

Save the table and paste the output code in the place of

1
2
3
4
5
6
7
CREATE TABLE IF NOT EXISTS `user` (
`username` varchar(64) NOT NULL,
`oauth_key` varchar(128) NOT NULL,
`oauth_secret` varchar(128) NOT NULL,
`password` varchar(32) NOT NULL,
PRIMARY KEY (`username`)
)

A sample code would be like this,

1
2
3
4
5
6
7
CREATE TABLE `database name`.`user` (
`username` VARCHAR( 64 ) NOT NULL ,
`oauth_key` VARCHAR( 128 ) NOT NULL ,
`oauth_secret` VARCHAR( 128 ) NOT NULL ,
`password` VARCHAR( 32 ) NOT NULL ,
PRIMARY KEY ( `username` )
) ENGINE = MYISAM ;

Now save the config.php file and go to your settings page to save a password for your profile! The same procedure applies to Kannada-Twitter too.

Here is a video on how to create tables in MySQL database using phpMyAdmin.

Enjoy! 🙂

Follow me on twitter @prasannasp

Short Link:

About the author

Prasanna SP

Student | WordPress Dev | Tech Blogger | Interested in GNU/Linux, FOSS, PHP, Drupal, WordPress, Ethical hacking, Photography, Painting, Literature etc..

Permanent link to this article: http://www.prasannasp.net/dabr-mysql-installation/

1 comment

  1. Ramesh

    I need to make use of multi language like Kannada in my MySQL DB using Java.

    Can you help me.

    I assume, you are from Karnataka by looking at your profile photo – Hampi

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code snippet between <code> and </code>. Comment moderation is in use. Please do not submit your comment twice -- it will appear shortly.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close