If you ever run to this problem that you cannot add Tomcat server to your Eclipse it is very easy to fix.
Go to Window–>Preferences–>Server–>Runtime Environments click edit and fix the broken path/link for the server. (Locate the Tomcat folder you have unzipped)
After that it should work.
Delete server
Right click servers from the left side menu, select delete and tick box delete from disk. Also from the bottom view of eclipse select servers and delete them there.
This page is a random collection of notes addressed to myself. Nothing here is intended as a guide per say, however i have posted them hoping that it may help someone. Blog about Coding and things related. Everything in this blog can be copied or edited GNU General Public License (version 2 or newer) http://www.gnu.org/licenses/gpl.html
torstai 26. syyskuuta 2013
maanantai 23. syyskuuta 2013
torstai 19. syyskuuta 2013
MySQL From Command line
If you have set up or you are going to use MySQL with SSH for example not via PHPMyadmin open your terminal and type
mysql -u username -p
Which means go to mysql, after -u put your username and -p is password, but do not enter your password after that it is going to ask it in the next prompt.
Enter your password (if you are using Putty press SHIFT + INSERT to paste)
Create new database:
CREATE DATABASE Niki_Aanitteet;
To select database you want to use insert
use databasename;
to see what tables you have type
show tables;
To see what you have in the tables type
select * from tablename;
As you can see it works with same commands as phpmyadmin. If you want to add a table here is my example code:
CREATE TABLE Niki_Aanitteet(
id SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
artisti VARCHAR(255) NOT NULL,
levyn_nimi VARCHAR(255) NOT NULL
) ENGINE=Innodb DEFAULT CHARSET=latin1;
And to insert some data into the tables:
INSERT INTO Niki_Aanitteet(artisti, levyn_nimi) VALUES('PSY', 'Gangnam Style');
INSERT INTO Niki_Aanitteet(artisti, levyn_nimi) VALUES('Train', 'Drive By');
INSERT INTO Niki_Aanitteet(artisti, levyn_nimi) VALUES('Rihanna', 'Where Have You Been');
To see field, type, null, key, default, extra information type:
describe Niki_Aanitteet;
Create new user for your database and grant all privileges:
CREATE USER 'shnigi'@'localhost' IDENTIFIED BY 'passwordhere';
GRANT ALL PRIVILEGES ON * . * TO 'shnigi'@'localhost';
Explained bit better here: https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-12-04
mysql -u username -p
Which means go to mysql, after -u put your username and -p is password, but do not enter your password after that it is going to ask it in the next prompt.
Enter your password (if you are using Putty press SHIFT + INSERT to paste)
Create new database:
CREATE DATABASE Niki_Aanitteet;
To select database you want to use insert
use databasename;
to see what tables you have type
show tables;
To see what you have in the tables type
select * from tablename;
As you can see it works with same commands as phpmyadmin. If you want to add a table here is my example code:
CREATE TABLE Niki_Aanitteet(
id SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
artisti VARCHAR(255) NOT NULL,
levyn_nimi VARCHAR(255) NOT NULL
) ENGINE=Innodb DEFAULT CHARSET=latin1;
And to insert some data into the tables:
INSERT INTO Niki_Aanitteet(artisti, levyn_nimi) VALUES('PSY', 'Gangnam Style');
INSERT INTO Niki_Aanitteet(artisti, levyn_nimi) VALUES('Train', 'Drive By');
INSERT INTO Niki_Aanitteet(artisti, levyn_nimi) VALUES('Rihanna', 'Where Have You Been');
To see field, type, null, key, default, extra information type:
describe Niki_Aanitteet;
Create new user for your database and grant all privileges:
CREATE USER 'shnigi'@'localhost' IDENTIFIED BY 'passwordhere';
GRANT ALL PRIVILEGES ON * . * TO 'shnigi'@'localhost';
Explained bit better here: https://www.digitalocean.com/community/articles/how-to-install-wordpress-with-nginx-on-ubuntu-12-04
create database testdatabase;
create user 'folio'@'localhost' identified by 'password123';
grant all privileges on testdatabase.* to 'folio'@'localhost' with grant option;
Tilaa:
Blogitekstit (Atom)