OHMySQLUser

@interface OHMySQLUser : NSObject

The entity that has authority to use a store MySQL.

  • Can be up to 16 characters long. Operating system user names may be of a different maximum length.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSString *userName;

    Swift

    var userName: String { get set }
  • Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSString *password;

    Swift

    var password: String { get set }
  • A host name or an IP address.

    Note

    Note that the host parameter determines the type of the connection.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSString *serverName;

    Swift

    var serverName: String { get set }
  • The string specifies the name of database.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nonnull) NSString *dbName;

    Swift

    var dbName: String { get set }
  • If it is not NULL, the string specifies the socket or named pipe to use.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *socket;

    Swift

    var socket: String? { get set }
  • If it is not 0, the value is used as the port number for the TCP/IP connection.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSUInteger port;

    Swift

    var port: UInt { get set }
  • Used for establishing secure connections using SSL.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) OHSSLConfig *sslConfig;

    Swift

    @NSCopying var sslConfig: OHSSLConfig? { get set }
  • Initializes and returns a newly allocated object.

    Declaration

    Objective-C

    - (nullable instancetype)initWithUserName:(nonnull NSString *)name
                                     password:(nonnull NSString *)password
                                   serverName:(nonnull NSString *)serverName
                                       dbName:(nonnull NSString *)dbName
                                         port:(NSUInteger)port
                                       socket:(nullable NSString *)socket;

    Swift

    init?(userName name: String, password: String, serverName: String, dbName: String, port: UInt, socket: String?)

    Parameters

    name

    The name of connecting user.

    password

    User’ password.

    serverName

    A host name or an IP address.

    dbName

    The name of database

    port

    Port number for TCP/IP connection.

    socket

    The socket or named pipe to use

    Return Value

    User object with the specified parameters

  • Initializes and returns a newly allocated object.

    Declaration

    Objective-C

    - (nullable instancetype)initWithUserName:(nonnull NSString *)name
                                     password:(nonnull NSString *)password
                                    sslConfig:(nonnull OHSSLConfig *)sslConfig
                                   serverName:(nonnull NSString *)serverName
                                       dbName:(nonnull NSString *)dbName
                                         port:(NSUInteger)port
                                       socket:(nullable NSString *)socket;

    Swift

    init?(userName name: String, password: String, sslConfig: OHSSLConfig, serverName: String, dbName: String, port: UInt, socket: String?)

    Parameters

    name

    The name of connecting user.

    password

    User’ password.

    sslConfig

    SSL config object to estable SSL connection.

    serverName

    A host name or an IP address.

    dbName

    The name of database.

    port

    Port number for TCP/IP connection.

    socket

    The socket or named pipe to use

    Return Value

    User object with the specified parameters