By default, MYSQL with INNODB engine doesn’t create 1 file per table, but rather stores everything in the system file.
Step 1:
edit /etc/mysql/my.cnf
[mysqld] innodb_file_per_table |
This will only enable file per table. It will not convert your existing innodb tables into files
There are a couple of ways of doing this
1st Method
mysqldump -udbuser -ppassword db_name > outfile.sql mysql -udbuser -ppassword db_name < outfile.sql |
2nd Method – run this sql script for each table in your database
ALTER TABLE tbl_name ENGINE=INNODB; |
This means each table is stored in its own file.
Later on, you can look at moving each file to its own hard disk for performance gains
This snippet is for 2 way encrypted socket communications between us and a server.
This is *NOT* for normal web HTTPS traffic.
import java.net.*; import java.security.*; private Socket setupSocket() { try { String serverIP = "192.168.0.1"; Integer serverPort = 8880; Integer timeOut = 5000;//5000 millisecond timeout //get the address and port of the server InetAddress addr = InetAddress.getByName(serverIP); SocketAddress sockaddr = new InetSocketAddress(addr, serverPort); //get a keystore instance KeyStore localKeyStore = KeyStore.getInstance("JKS"); //password for keystore char[] localKeyStorePassword = "keyStorePassword".toCharArray(); //load the keystore localKeyStore.load(new FileInputStream("/var/local/keystore.jks"), localKeyStorePassword); //Create the trust manager factory TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); //point it to the local keystore for certificates tmf.init( localKeyStore ); //create the keymanager KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); //point it to the local store for certificates kmf.init(localKeyStore, localKeyStorePassword); //create and initialize a secure random number generator SecureRandom secureRandom = new SecureRandom(); secureRandom.nextInt(); // Force initialisation to occur now. //create our sslcontext and set it as type TLS SSLContext sslContext = SSLContext.getInstance("TLS"); //initialize it and tell it where the keystore and truststore are sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), secureRandom); //create a socket factory from our newly initialized sslContext SSLSocketFactory sf = sslContext.getSocketFactory(); //get a socket from the factory SSLSocket skt = (SSLSocket)sf.createSocket();//create the socket but dont connect yet //connect to the previously created address/port with a timeout skt.connect(sockaddr, timeOut); //set the timeout for any comms skt.setSoTimeout(timeOut); return skt; }catch( Exception e ) { return null; } } |

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 