Mysql in the database and create a user

  Abstract: mysql database users and create 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> 1. Your root login to use mysql, and methods: 
  C: \ mysql \ bin \ mysql-uroot-p 
  2. Javauser to create a user with the password javadude, has competence: at any of the database on the mainframe operating arbitrary javatest 
  Mysql> GRANT ALL PRIVILEGES ON javatest .* TO javauser @ "%" 
  –> IDENTIFIED BY "javadude"; 

  <table Width="665" height="31" border="0"> <tr> <td width="365" valign="top"> 3 Create Database 

  Mysql> create database javatest; 

  4. Create Table 
  Mysql> use javatest; 
  Mysql> create table testdata ( 
  –> Id int not null auto_increment primary key, 
  –> Foo varchar (25), 
  –> Bar int); 

  5. Insert the few 

  Mysql> insert into testdata values (null, 'hello', 12345); 
  Query OK, a row affected (0.00 sec) 

  Mysql> select * from testdata; </ td> <td width="290"> </ td> </ tr> </ table> 
+—-+——-+——-+
  | ID | FOO | BAR | 
+—-+——-+——-+
  | 1 | hello | 12345 | 
+—-+——-+——-+
  1 row in set (0.00 sec) 

  Mysql> </ td> </ tr> <tr> 

  ↑ Back 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • DotNetKicks
  • DZone
  • Netvouz
  • Propeller

Tags:

Releated Java Articles

Comments

Leave a Reply